[Koha-patches] [PATCH 2/2] cleanup of DB-dependent fund test cases

Galen Charlton gmcharlt at gmail.com
Wed Oct 6 17:14:02 CEST 2010


* remove test that was adding a second active budget period,
  which was throwing off later tests
* updated to reflect current API

Signed-off-by: Galen Charlton <gmcharlt at gmail.com>
---
 t/db_dependent/Budgets.t |   23 +++--------------------
 1 files changed, 3 insertions(+), 20 deletions(-)

diff --git a/t/db_dependent/Budgets.t b/t/db_dependent/Budgets.t
index 7d5732f..6ec8b57 100755
--- a/t/db_dependent/Budgets.t
+++ b/t/db_dependent/Budgets.t
@@ -1,12 +1,11 @@
 use strict;
 use warnings;
-use Test::More tests=>18;
+use Test::More tests=>17;
 
 BEGIN {use_ok('C4::Budgets') }
 use C4::Budgets;
 use C4::Dates;
 
-print "ok 1\n";
 use YAML;
 
 #
@@ -23,21 +22,6 @@ ok($bpid=AddBudgetPeriod(
 						, budget_description		=> "MAPERI"}),
 	"AddBudgetPeriod with iso dates OK");
 
-if (C4::Context->preference('dateformat') eq "metric"){
-	ok($bpid=AddBudgetPeriod(
-						{ budget_period_startdate	=> '01-01-2008'
-						, budget_period_enddate		=> '31-12-2008'
-						, budget_description		=> "MAPERI"}),
-	"AddBudgetPeriod returned $bpid");
-} 
-elsif (C4::Context->preference('dateformat') eq "us"){
-	ok($bpid=AddBudgetPeriod(
-						{ budget_period_startdate	=> '01-01-2008'
-						, budget_period_enddate		=> '12-31-2008'
-						, budget_description		=> "MAPERI"}),
-	"AddBudgetPeriod returned $bpid");
-}
-
 ok($budgetperiod=GetBudgetPeriod($bpid),
 	"GetBudgetPeriod($bpid) returned ".Dump($budgetperiod));
 ok(!GetBudgetPeriod(0) ,"GetBudgetPeriod(0) returned undef : noactive BudgetPeriod");
@@ -95,7 +79,6 @@ ok($budget_id=AddBudget(
 #| budget_encumb          | decimal(28,6) | YES  |     | 0.000000          |       | 
 #| budget_expend          | decimal(28,6) | YES  |     | 0.000000          |       | 
 #| budget_notes           | mediumtext    | YES  |     | NULL              |       | 
-#| budget_description     | mediumtext    | YES  |     | NULL              |       | 
 #| timestamp              | timestamp     | NO   |     | CURRENT_TIMESTAMP |       | 
 #| budget_period_id       | int(11)       | YES  | MUL | NULL              |       | 
 #| sort1_authcat          | varchar(80)   | YES  |     | NULL              |       | 
@@ -111,9 +94,9 @@ ok(GetBudgets()>0,
 	"GetBudgets OK");
 ok(GetBudgets({budget_period_id=>$bpid})>0,
 	"GetBudgets With Filter OK");
-ok(GetBudgets({budget_period_id=>$bpid},{"budget_description"=>0})>0,
+ok(GetBudgets({budget_period_id=>$bpid},[{"budget_name"=>0}])>0,
 	"GetBudgets With Order OK");
-ok(GetBudgets({budget_period_id=>GetBudgetPeriod(0)->{budget_period_id}},{"budget_description"=>0})>0,
+ok(GetBudgets({budget_period_id=>GetBudgetPeriod($bpid)->{budget_period_id}},[{"budget_name"=>0}])>0,
 	"GetBudgets With Order 
 	Getting Active budgetPeriod OK");
 ok($del_status=DelBudget($budget_id),
-- 
1.7.0



More information about the Koha-patches mailing list