Bug 8435: (follow-up) use a transaction for unit tests

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This commit is contained in:
Jonathan Druart 2013-06-28 09:27:39 +02:00 committed by Galen Charlton
parent dc3dd3ede6
commit 56ee35d3fb

View file

@ -6,6 +6,10 @@ use Test::More tests => 4;
use_ok('C4::Serials');
use_ok('C4::Budgets');
my $dbh = C4::Context->dbh;
$dbh->{AutoCommit} = 0;
$dbh->{RaiseError} = 1;
my $supplierlist=eval{GetSuppliersWithLateIssues()};
ok(length($@)==0,"No SQL problem in GetSuppliersWithLateIssues");
@ -58,8 +62,4 @@ my $subscription = GetSubscription( $subscriptionid );
is( C4::Serials::can_edit_subscription($subscription), 1, "User can edit a subscription with an empty branchcode");
#TODO add UT when C4::Auth->set_permissions (or setuserflags) will exist.
# cleaning
DelSubscription( $subscription->{subscriptionid} );
DelBudgetPeriod($bpid);
DelBudget($budget_id);
$dbh->rollback;