From 353ebd72422a93b9ea7e91bb2cd86967133c31bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Tue, 6 Dec 2022 07:04:36 +0800 Subject: [PATCH] Revised the test_run test of the RunTestCase test case to test the failure adding the transfer transaction. --- tests/test_run.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/test_run.py b/tests/test_run.py index 5643d94..fa9762f 100644 --- a/tests/test_run.py +++ b/tests/test_run.py @@ -109,6 +109,30 @@ class RunTestCase(unittest.TestCase): self.assertNotEqual(response.headers["Location"], "/accounting/transactions/income/create?r=/ok") + response = self.client.post( + "/accounting/transactions/transfer/create?r=/ok", + {"date": today, + "debit-2-ord": 6, + "debit-2-summary": "lunch", + "debit-2-amount": 80, + "debit-2-account": "6272", + "debit-8-ord": 4, + "debit-8-summary": "movies", + "debit-8-amount": 320, + "debit-8-account": "6273", + "credit-3-ord": 7, + "credit-3-summary": "withdrawal", + "credit-3-amount": 100, + "credit-3-account": "1113", + "credit-6-ord": 3, + "credit-6-summary": "", + "credit-6-amount": 320, + "credit-6-account": "1111", + "notes": "nothing"}) + self.assertEqual(response.status_code, 302) + self.assertEqual(response.headers["Location"], + "/accounting/transactions/transfer/create?r=/ok") + response = self.client.post( "/accounting/transactions/transfer/create?r=/ok", {"date": today,