From 42a94dde957229d31df5096aba9bda45c8d97588 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 15 Feb 2019 14:40:34 +0000 Subject: [PATCH] Bug 22349: Remove overzealous database deletions from test For no apparent reason a whole lot of data was being deleted inside a transaction for each of the subtests in Koha/Acquisitions/Booksellers.t This patch simply remove the deletions. To test, run the test before and after applying the patch and they should all continue to pass.. If you have a large number of booksellers, baskets, orders or subscriptions in your database you may also see an decrease in the time it takes to run the test. Signed-off-by: Jonathan Druart --- t/db_dependent/Koha/Acquisition/Booksellers.t | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/t/db_dependent/Koha/Acquisition/Booksellers.t b/t/db_dependent/Koha/Acquisition/Booksellers.t index 010993e059..e3870cd9f8 100644 --- a/t/db_dependent/Koha/Acquisition/Booksellers.t +++ b/t/db_dependent/Koha/Acquisition/Booksellers.t @@ -39,11 +39,6 @@ subtest '->baskets() tests' => sub { $schema->storage->txn_begin(); - # Delete existing data - $schema->resultset('Aqorder')->delete(); - $schema->resultset('Aqbasket')->delete(); - Koha::Acquisition::Booksellers->delete(); - $schema->resultset('Subscription')->delete(); my $patron = $builder->build_object({ class => 'Koha::Patrons' }); my $vendor = $builder->build_object( { class => 'Koha::Acquisition::Booksellers' } ); @@ -67,12 +62,6 @@ subtest '->subscriptions() tests' => sub { $schema->storage->txn_begin(); - # Delete existing data - $schema->resultset('Aqorder')->delete(); - $schema->resultset('Aqbasket')->delete(); - Koha::Acquisition::Booksellers->delete(); - $schema->resultset('Subscription')->delete(); - my $vendor = $builder->build_object( { class => 'Koha::Acquisition::Booksellers' } ); is( $vendor->subscriptions->count, 0, 'Vendor has no subscriptions' ); @@ -154,12 +143,6 @@ subtest '->contacts() tests' => sub { $schema->storage->txn_begin(); - # Delete existing data - $schema->resultset('Aqorder')->delete(); - $schema->resultset('Aqbasket')->delete(); - Koha::Acquisition::Booksellers->delete(); - $schema->resultset('Subscription')->delete(); - my $vendor = $builder->build_object( { class => 'Koha::Acquisition::Booksellers' } ); is( $vendor->contacts->count, 0, 'Vendor has no contacts' ); -- 2.11.0