[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[2697] trunk/sql/modules/test/Reconciliation.sql



Revision: 2697
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2697&view=rev
Author:   einhverfr
Date:     2009-06-17 20:51:47 +0000 (Wed, 17 Jun 2009)

Log Message:
-----------
Performance fix to test cases

Modified Paths:
--------------
    trunk/sql/modules/test/Reconciliation.sql

Modified: trunk/sql/modules/test/Reconciliation.sql
===================================================================
--- trunk/sql/modules/test/Reconciliation.sql	2009-06-17 18:36:34 UTC (rev 2696)
+++ trunk/sql/modules/test/Reconciliation.sql	2009-06-17 20:51:47 UTC (rev 2697)
@@ -47,7 +47,9 @@
 SELECT '1 Report Approved', reconciliation__report_approve(currval('cr_report_id_seq')::int) > 0;
 
 INSERT INTO test_result(test_name, success)
-SELECT '1 Transactions closed', count(*) = 2 FROM acc_trans where chart_id = test_get_account_id('-11111') and cleared is false;
+SELECT '1 Transactions closed', count(*) = 2 FROM acc_trans 
+JOIN account a ON (acc_trans.chart_id = a.id) 
+WHERE a.accno = '-11111' and cleared is false;
 
 INSERT INTO test_result(test_name, success)
 SELECT '1 Create Recon Report', 
@@ -85,7 +87,9 @@
 SELECT '1 Report Approved', reconciliation__report_approve(currval('cr_report_id_seq')::int) > 0;
 
 INSERT INTO test_result(test_name, success)
-SELECT '1 Transactions open', count(*) = 14 FROM acc_trans where chart_id = test_get_account_id('-11112') and cleared is false;
+SELECT '1 Transactions open', count(*) = 14 FROM acc_trans 
+JOIN account ON (acc_trans.chart_id = account.id)
+WHERE accno = '-11112'  and cleared is false;
 
 INSERT INTO test_result(test_name, success)
 SELECT '1 Cleared balance post-approval is 10', reconciliation__get_cleared_balance(test_get_account_id('-11112')) = -10;
@@ -117,7 +121,9 @@
 SELECT 'Report Approved', reconciliation__report_approve(currval('cr_report_id_seq')::int) > 0;
 
 INSERT INTO test_result(test_name, success)
-SELECT 'Transactions closed', count(*) = 2 FROM acc_trans where chart_id = test_get_account_id('-11111') and cleared is false;
+SELECT 'Transactions closed', count(*) = 2 FROM acc_trans 
+JOIN account a ON (acc_trans.chart_id = a.id)
+WHERE accno = '-11112' and cleared is false;
 
 INSERT INTO test_result(test_name, success)
 SELECT 'Cleared balance post-approval is 130', reconciliation__get_cleared_balance(test_get_account_id('-11112')) = -130;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.