From 8c3b7dc0c2031431c9a6de8f58ee20ba59f8c13b Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Mon, 24 Sep 2018 11:06:47 +0000 Subject: [PATCH] Bug 15494: Update tests to generate their own data (no delete) --- t/db_dependent/Circulation.t | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t index a491529..df4c86a 100755 --- a/t/db_dependent/Circulation.t +++ b/t/db_dependent/Circulation.t @@ -2216,16 +2216,14 @@ subtest 'ItemsDeniedRenewal preference' => sub { t::lib::Mocks::mock_preference( 'ItemsDeniedRenewal', '' ); - $dbh->do('DELETE FROM issues'); - $dbh->do('DELETE FROM items'); - $dbh->do('DELETE FROM issuingrules'); + my $idr_lib = $builder->build_object({ class => 'Koha::Libraries'}); $dbh->do( q{ INSERT INTO issuingrules ( categorycode, branchcode, itemtype, reservesallowed, maxissueqty, issuelength, lengthunit, renewalsallowed, renewalperiod, norenewalbefore, auto_renew, fine, chargeperiod ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ) }, {}, - '*', '*', '*', 25, + '*', $idr_lib->branchcode, '*', 25, 20, 14, 'days', 10, 7, undef, 0, @@ -2233,6 +2231,7 @@ subtest 'ItemsDeniedRenewal preference' => sub { ); my $deny_book = $builder->build_object({ class => 'Koha::Items', value => { + homebranch => $idr_lib->branchcode, withdrawn => 1, itype => 'HIDE', location => 'PROC', @@ -2241,13 +2240,17 @@ subtest 'ItemsDeniedRenewal preference' => sub { } }); my $allow_book = $builder->build_object({ class => 'Koha::Items', value => { + homebranch => $idr_lib->branchcode, withdrawn => 0, itype => 'NOHIDE', location => 'NOPROC' } }); - my $idr_borrower = $builder->build_object({ class => 'Koha::Patrons'}); + my $idr_borrower = $builder->build_object({ class => 'Koha::Patrons', value=> { + branchcode => $idr_lib->branchcode, + } + }); my $future = dt_from_string->add( days => 1 ); my $deny_issue = $builder->build_object({ class => 'Koha::Checkouts', value => { returndate => undef, -- 2.1.4