Bug 10535: (follow-up) wrap Budgets.t in transaction
authorGalen Charlton <gmc@esilibrary.com>
Thu, 17 Oct 2013 23:05:15 +0000 (23:05 +0000)
committerGalen Charlton <gmc@esilibrary.com>
Thu, 17 Oct 2013 23:06:49 +0000 (23:06 +0000)
This patch also temporarily removes any existing
budgets to avoid issues where tests can fail if there
is already an active budget in the database.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
t/db_dependent/Budgets.t

index baaa1a1..bfb910b 100755 (executable)
@@ -4,9 +4,16 @@ use Test::More tests=>20;
 
 BEGIN {use_ok('C4::Budgets') }
 use C4::Dates;
+use C4::Context;
 
 use YAML;
 
+my $dbh = C4::Context->dbh();
+$dbh->{AutoCommit} = 0;
+$dbh->{RaiseError} = 1;
+
+$dbh->do('DELETE FROM aqbudgetperiods');
+
 #
 # Budget Periods :
 #