From 4ecdef8dd458fe1f71c29582fa0685fd779664a9 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 2 Sep 2022 07:00:15 +0000 Subject: [PATCH] Bug 20058: (QA follow-up) Simplify test code --- t/db_dependent/SIP/Message.t | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/t/db_dependent/SIP/Message.t b/t/db_dependent/SIP/Message.t index 84aa2aac29..f2dca3b563 100755 --- a/t/db_dependent/SIP/Message.t +++ b/t/db_dependent/SIP/Message.t @@ -122,9 +122,6 @@ subtest 'UseLocationAsAQInSIP syspref tests' => sub { my $builder = t::lib::TestBuilder->new(); my $branchcode = $builder->build({ source => 'Branch' })->{branchcode}; - my $branchcode_permanent_location = $builder->build({ source => 'Branch' })->{branchcode}; - - my $mocks = create_mocks( \$branchcode, \$branchcode_permanent_location ); t::lib::Mocks::mock_preference('UseLocationAsAQInSIP', 0); @@ -136,7 +133,7 @@ subtest 'UseLocationAsAQInSIP syspref tests' => sub { restricted => 0, homebranch => $branchcode, holdingbranch => $branchcode, - permanent_location => $branchcode_permanent_location + permanent_location => "PERMANENT_LOCATION" } ); @@ -145,20 +142,8 @@ subtest 'UseLocationAsAQInSIP syspref tests' => sub { t::lib::Mocks::mock_preference('UseLocationAsAQInSIP', 1); - $item = $builder->build_sample_item( - { - damaged => 0, - withdrawn => 0, - itemlost => 0, - restricted => 0, - homebranch => $branchcode, - holdingbranch => $branchcode, - permanent_location => $branchcode_permanent_location - } - ); - $sip_item = C4::SIP::ILS::Item->new( $item->barcode ); - is( $sip_item->permanent_location, $branchcode_permanent_location, "When UseLocationAsAQInSIP is set SIP item has permanent_location set to value of item permanent_location" ); + is( $sip_item->permanent_location, "PERMANENT_LOCATION", "When UseLocationAsAQInSIP is set SIP item has permanent_location set to value of item permanent_location" ); $schema->storage->txn_rollback; }; -- 2.30.2