From 47cf3ec24ded468ca4b7b79c8b000b1bdb13d1a8 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Mon, 8 Jul 2013 14:27:14 +0000 Subject: [PATCH] Bug 10289: (follow-up) wrap tests in transaction Applying new standard method for handling tear-down of test data. Signed-off-by: Galen Charlton --- t/db_dependent/Reserves.t | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t index 203362017e..2c274a2c82 100755 --- a/t/db_dependent/Reserves.t +++ b/t/db_dependent/Reserves.t @@ -14,6 +14,12 @@ BEGIN { use_ok('C4::Reserves'); } +my $dbh = C4::Context->dbh; + +# Start transaction +$dbh->{AutoCommit} = 0; +$dbh->{RaiseError} = 1; + # Setup Test------------------------ # Helper biblio. diag("\nCreating biblio instance for testing."); @@ -71,18 +77,3 @@ is($status, "Reserved", "CheckReserves Test 2"); ($status, $reserve, $all_reserves) = CheckReserves(undef, $barcode); is($status, "Reserved", "CheckReserves Test 3"); - - -# Teardown Test--------------------- -# Delete item. -diag("Deleting item testing instance."); -my $dbh = C4::Context->dbh; -DelItem($dbh, $bibnum, $itemnumber); - -# Delete helper Biblio. -diag("Deleting biblio testing instance."); -DelBiblio($bibnum); - -# Delete borrower -diag("Deleting borrower."); -DelMember($borrowernumber); -- 2.39.5