From 7f1393a4273865393ea1849588b566cdb73856e3 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 22 Jan 2016 18:23:59 +0000 Subject: [PATCH] Bug 15084 [QA Followup] - Clean up test currencies after unit tests Test currency left behind will cuase next run of the unit test to fail as well as leaving db cruft. Signed-off-by: Kyle M Hall --- t/db_dependent/Koha/Acquisition/Currencies.t | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/t/db_dependent/Koha/Acquisition/Currencies.t b/t/db_dependent/Koha/Acquisition/Currencies.t index 2abf992..99c393e 100644 --- a/t/db_dependent/Koha/Acquisition/Currencies.t +++ b/t/db_dependent/Koha/Acquisition/Currencies.t @@ -19,10 +19,18 @@ use Modern::Perl; use Test::More tests => 6; +use Koha::Database; use Koha::Acquisition::Currency; use Koha::Acquisition::Currencies; use t::lib::TestBuilder; +my $schema = Koha::Database->schema; +$schema->storage->txn_begin; +my $dbh = C4::Context->dbh; + +# Start transaction +$dbh->{RaiseError} = 1; + my $builder = t::lib::TestBuilder->new; my $nb_of_currencies = Koha::Acquisition::Currencies->search->count; my $new_currency_1 = Koha::Acquisition::Currency->new({ @@ -56,3 +64,4 @@ is ( $nb_of_active_currencies, 1, 'Only 1 currency should be marked as active' ) $retrieved_currency_1->delete; is( Koha::Acquisition::Currencies->search->count, $nb_of_currencies + 1, 'Delete should have deleted the currency' ); + -- 2.7.0