diff options
author | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2008-10-10 18:57:51 +0000 |
---|---|---|
committer | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2008-10-10 18:57:51 +0000 |
commit | dc64f7ea37253265420d1a7e375c9c966c62cea8 (patch) | |
tree | c80c55d8f9decd5d2693277a8ddbd1ab2385bb00 /sql/modules/test | |
parent | 7f05e02bbebe6777e0389d2bec943e2bf376031a (diff) |
Renaming broken Account.sql function (currently unused by app)
All Account.sql tests now pass.
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@2364 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'sql/modules/test')
-rw-r--r-- | sql/modules/test/Account.sql | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/sql/modules/test/Account.sql b/sql/modules/test/Account.sql index d2f1545d..23597c8e 100644 --- a/sql/modules/test/Account.sql +++ b/sql/modules/test/Account.sql @@ -8,6 +8,10 @@ VALUES ('TEST testing 1', 'A', 'A', '00001'); INSERT INTO chart (description, charttype, category, accno) VALUES ('TEST testing 2', 'A', 'A', '00002'); +INSERT INTO ap (invnumber, netamount, amount) VALUES ('TEST', '0', '0'); +INSERT INTO acc_trans (trans_id, chart_id, amount) +VALUES (currval('id')::int, currval('chart_id_seq')::int, '0'); + INSERT INTO chart (description, charttype, category, accno, link) VALUES ('TEST AP 1', 'A', 'L', '00003', 'AP'); @@ -71,15 +75,11 @@ VALUES ('TEST AP Overpayment 4 INVALID', 'A', 'A', '00022', 'AR_overp'); INSERT INTO test_result(test_name, success) VALUES ('Accounts created', currval('chart_id_seq') is not null); -INSERT INTO ap (invnumber, netamount, amount) VALUES ('TEST', '0', '0'); -INSERT INTO acc_trans (trans_id, chart_id, amount) -VALUES (currval('id')::int, currval('chart_id_seq')::int, '0'); - INSERT INTO test_result(test_name, success) -VALUES ('Chart 1 is orphaned', account_is_orphaned((select id from chart where description = 'TEST testing 1'))); +VALUES ('Chart 1 is orphaned', account_has_transactions((select id from chart where description = 'TEST testing 1')) is false); INSERT INTO test_result(test_name, success) -VALUES ('Chart 2 is not orphaned', account_is_orphaned(currval('chart_id_seq')::int) is false); +VALUES ('Chart 2 is not orphaned', account_has_transactions((select id from chart where accno = '00002')) is true); INSERT INTO test_result(test_name, success) SELECT 'All Test Accounts Exist', count(*) = 22 FROM chart_list_all() @@ -116,7 +116,4 @@ SELECT (select count(*) from test_result where success is true) || (select count(*) from test_result where success is not true) || ' failed' as message; -\echo This currently fails 2 tests due to some confusion as to -\echo account_is_orphaned is supposed to do. - ROLLBACK; |