Bug 20058: (QA follow-up) Simplify test code

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Nick Clemens 2022-09-02 07:00:15 +00:00 committed by Tomas Cohen Arazi
parent 845978d45c
commit 1e9f6e61d5
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -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;
};