From d91d7b01731fa8a6c0e9df47a75d188035275656 Mon Sep 17 00:00:00 2001
From: Kyle M Hall <kyle@bywatersolutiosn.com>
Date: Thu, 16 Aug 2018 07:10:43 -0400
Subject: [PATCH] Bug 21231: Add Unit Test

---
 t/db_dependent/Circulation/Returns.t | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/t/db_dependent/Circulation/Returns.t b/t/db_dependent/Circulation/Returns.t
index 50f733bb52..bd21347694 100644
--- a/t/db_dependent/Circulation/Returns.t
+++ b/t/db_dependent/Circulation/Returns.t
@@ -337,7 +337,7 @@ subtest 'Handle ids duplication' => sub {
 };
 
 subtest 'BlockReturnOfLostItems' => sub {
-    plan tests => 3;
+    plan tests => 4;
     my $biblio = $builder->build_object( { class => 'Koha::Biblios' } );
     my $item = $builder->build_object(
         {
@@ -361,6 +361,9 @@ subtest 'BlockReturnOfLostItems' => sub {
     is( $doreturn, 0, "With BlockReturnOfLostItems, a checkin of a lost item should be blocked");
     is( $messages->{WasLost}, 1, "... and the WasLost flag should be set");
 
+    $item->discard_changes;
+    is( $item->itemlost, 1, "Item remains lost" );
+
     t::lib::Mocks::mock_preference('BlockReturnOfLostItems', 0);
     ( $doreturn, $messages, $issue ) = AddReturn($item->barcode);
     is( $doreturn, 1, "Without BlockReturnOfLostItems, a checkin of a lost item should not be blocked");
-- 
2.11.0