[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[2909] trunk/sql/modules/test
- Subject: SF.net SVN: ledger-smb:[2909] trunk/sql/modules/test
- From: ..hidden..
- Date: Wed, 24 Feb 2010 18:07:39 +0000
Revision: 2909
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2909&view=rev
Author: einhverfr
Date: 2010-02-24 18:07:39 +0000 (Wed, 24 Feb 2010)
Log Message:
-----------
Refactored for easier addition of test cases
Modified Paths:
--------------
trunk/sql/modules/test/Base.sql
trunk/sql/modules/test/Payment.sql
trunk/sql/modules/test/Session.sql
trunk/sql/modules/test/data/Reconciliation.sql
Modified: trunk/sql/modules/test/Base.sql
===================================================================
--- trunk/sql/modules/test/Base.sql 2010-02-24 18:04:20 UTC (rev 2908)
+++ trunk/sql/modules/test/Base.sql 2010-02-24 18:07:39 UTC (rev 2909)
@@ -3,6 +3,17 @@
success bool
);
+INSERT INTO entity (id, name, entity_class, control_code, country_id)
+VALUES (-100, 'Testing.....', 3, '_TESTING.....', 242);
+
+DELETE FROM users WHERE username = CURRENT_USER;
+
+INSERT INTO users (entity_id, username)
+SELECT -100, CURRENT_USER;
+
+INSERT INTO entity(name, id, entity_class, control_code, country_id)
+values ('test user 1', -200, 3, 'Test User 1', 242);
+
select account_heading_save(NULL, '000000000000000000000', 'TEST', NULL);
INSERT INTO account(id, accno, description, category, heading, contra)
Modified: trunk/sql/modules/test/Payment.sql
===================================================================
--- trunk/sql/modules/test/Payment.sql 2010-02-24 18:04:20 UTC (rev 2908)
+++ trunk/sql/modules/test/Payment.sql 2010-02-24 18:07:39 UTC (rev 2909)
@@ -1,17 +1,7 @@
BEGIN;
\i Base.sql
-INSERT INTO entity (id, name, entity_class, control_code, country_id)
-VALUES (-100, 'Testing.....', 3, '_TESTING.....', 242);
-DELETE FROM users WHERE username = CURRENT_USER;
-
-INSERT INTO users (entity_id, username)
-SELECT -100, CURRENT_USER;
-
-INSERT INTO entity(name, id, entity_class, control_code, country_id)
-values ('test user 1', -200, 3, 'Test User 1', 242);
-
insert into users (entity_id, username, id)
values (-200, '_test1', -200);
Modified: trunk/sql/modules/test/Session.sql
===================================================================
--- trunk/sql/modules/test/Session.sql 2010-02-24 18:04:20 UTC (rev 2908)
+++ trunk/sql/modules/test/Session.sql 2010-02-24 18:07:39 UTC (rev 2909)
@@ -6,12 +6,6 @@
values ('timeout set',
(select count(*) from defaults where setting_key = 'timeout') = 1);
-INSERT INTO entity (name, entity_class, control_code, country_id)
-VALUES ('Testing.....', 3, '_TESTING.....',242);
-
-INSERT INTO users (entity_id, username)
-SELECT currval('entity_id_seq'), CURRENT_USER;
-
INSERT INTO session (users_id, last_used, token, transaction_id)
SELECT currval('users_id_seq'),
now() - coalesce((select value from defaults where setting_key = 'timeout')::interval,
Modified: trunk/sql/modules/test/data/Reconciliation.sql
===================================================================
--- trunk/sql/modules/test/data/Reconciliation.sql 2010-02-24 18:04:20 UTC (rev 2908)
+++ trunk/sql/modules/test/data/Reconciliation.sql 2010-02-24 18:07:39 UTC (rev 2909)
@@ -3,10 +3,10 @@
INSERT INTO chart (id, accno, description, category, charttype) values (-200, '-11111', 'Test Acct 1', 'A', 'A');
INSERT INTO chart (id, accno, description, category, charttype) values (-201, '-11112', 'Test Acct 2', 'A', 'A');
-INSERT INTO entity (id, control_code, name, entity_class, country_id) values (-200, '-11111', 'Test 1', 1, 242);
+INSERT INTO entity (id, control_code, name, entity_class, country_id) values (-201, '-11111', 'Test 1', 1, 242);
-INSERT INTO entity_credit_account (entity_id, id, meta_number, entity_class, ar_ap_account_id) values (-200, -200, 'T-11111', 1, -1000);
-INSERT INTO entity_credit_account (entity_id, id, meta_number, entity_class, ar_ap_account_id) values (-200, -201, 'T-11112', 1, -1000);
+INSERT INTO entity_credit_account (entity_id, id, meta_number, entity_class, ar_ap_account_id) values (-201, -200, 'T-11111', 1, -1000);
+INSERT INTO entity_credit_account (entity_id, id, meta_number, entity_class, ar_ap_account_id) values (-201, -201, 'T-11112', 1, -1000);
INSERT INTO ar (id, invnumber, amount, netamount, paid, entity_credit_account, transdate, curr) values (-200, '-2000', '10', '10', '0', -200, '1000-01-01', 'USD');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.