From 2c7e0207ab30c66673e47f2e80c1526b2e90a0ce Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 1 Nov 2018 13:11:16 +0000 Subject: [PATCH] Bug 19915: Don't delete in tests --- t/db_dependent/Items/GetItemsForInventory.t | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/Items/GetItemsForInventory.t b/t/db_dependent/Items/GetItemsForInventory.t index a7a8e7039d..7e3f99d56a 100755 --- a/t/db_dependent/Items/GetItemsForInventory.t +++ b/t/db_dependent/Items/GetItemsForInventory.t @@ -46,7 +46,6 @@ subtest 'Use cn_sort rather than callnumber to determine correct location' => su plan tests => 1; my $builder = t::lib::TestBuilder->new; - Koha::Items->delete; my $class_rule = $builder->build({ source => 'ClassSortRule', @@ -58,6 +57,14 @@ subtest 'Use cn_sort rather than callnumber to determine correct location' => su class_sort_rule => $class_rule->{class_sort_rule}, } }); + + #Find if we have any items in our test range before we start + my( undef, $pre_item_count) = GetItemsForInventory({ + maxlocation => 'GT100', + minlocation => 'GT90', + class_source => $class_source->{cn_source}, + }); + my $item_1 = $builder->build({ source => 'Item', value => { @@ -71,7 +78,7 @@ subtest 'Use cn_sort rather than callnumber to determine correct location' => su minlocation => 'GT90', class_source => $class_source->{cn_source}, }); - is($item_count,1,"We should return GT95 as between GT90 and GT100"); + is($item_count,$pre_item_count + 1,"We should return GT95 as between GT90 and GT100"); }; -- 2.11.0