Bug 18620: [QA Follow-up] Move the final rollback to the very end
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Fri, 26 May 2017 09:20:42 +0000 (11:20 +0200)
committerKyle M Hall <kyle@bywatersolutions.com>
Mon, 29 May 2017 02:17:13 +0000 (22:17 -0400)
The new subtest in Reserves.t does not need its own transaction.
Move the original rollback to the very end of the test.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
https://bugs.koha-community.org/show_bug.cgi?id=18478

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
t/db_dependent/Reserves.t

index 1a2d33c..0d23816 100755 (executable)
@@ -714,15 +714,10 @@ $cache->clear_from_cache("MarcStructure-1-$frameworkcode");
 $cache->clear_from_cache("default_value_for_mod_marc-$frameworkcode");
 $cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode");
 
-# we reached the finish
-$schema->storage->txn_rollback();
-
 subtest '_koha_notify_reserve() tests' => sub {
 
     plan tests => 2;
 
-    $schema->storage->txn_begin;
-
     my $wants_hold_and_email = {
         wants_digest => '0',
         transports => {
@@ -790,8 +785,6 @@ subtest '_koha_notify_reserve() tests' => sub {
         })->next()->to_address();
     is($email_message_address, undef ,"We should not populate the hold message with the email address, sending will do so");
 
-    $schema->storage->txn_rollback();
-
 };
 
 sub count_hold_print_messages {
@@ -803,3 +796,6 @@ sub count_hold_print_messages {
     });
     return $message_count->[0]->[0];
 }
+
+# we reached the finish
+$schema->storage->txn_rollback();