Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LP 1198465: Load negative balance test transactions in load_all.sql
This commit integrates the SQL needed to setup negative balance testing into the load_all.sql which loads the rest of the test data. It also separates out the "reset" commands into a separate SQL file. They are useful when doing repeated testing, but unnecessary and may eventually require manual tweaking, so they are provided here as a convenience only. Signed-off-by: Dan Wells <dbw2@calvin.edu> Signed-off-by: Remington Steed <rjs7@calvin.edu>
- Loading branch information
Showing
3 changed files
with
23 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
BEGIN; | ||
|
||
-- RESET DATA FOR LIVE TESTING LP#1198465: | ||
-- Support for Conditional Negative Balances | ||
-- | ||
-- After running this, reload neg_bal_custom_transactions.sql. | ||
-- Once both files are run, the tests should succeed again. | ||
|
||
-- clear bills and payments for our test circs | ||
DELETE FROM money.billing WHERE xact <= 16; | ||
DELETE FROM money.payment WHERE xact <= 16; | ||
|
||
-- clear any non-stock settings | ||
-- XXX This will need adjusting if new stock settings are added, so | ||
-- TODO: Pad out org_unit_settings with a SETVAL like we do for other | ||
-- settings | ||
DELETE FROM actor.org_unit_setting WHERE id >= 14; | ||
|
||
-- clear out the test workstation (just in case) | ||
DELETE FROM actor.workstation WHERE name = 'BR1-test-09-lp1198465_neg_balances.t'; | ||
|
||
COMMIT; |