Revised the test_run test of the RunTestCase test case to test if the result is successful.

This commit is contained in:
依瑪貓 2022-12-06 07:03:12 +08:00
parent 999b593c64
commit 467739e0c8

View File

@ -90,6 +90,8 @@ class RunTestCase(unittest.TestCase):
"debit-8-account": "6273", "debit-8-account": "6273",
"notes": "yammy"}) "notes": "yammy"})
self.assertEqual(response.status_code, 302) self.assertEqual(response.status_code, 302)
self.assertNotEqual(response.headers["Location"],
"/accounting/transactions/expense/create?r=/ok")
response = self.client.post( response = self.client.post(
"/accounting/transactions/income/create?r=/ok", "/accounting/transactions/income/create?r=/ok",
@ -104,6 +106,8 @@ class RunTestCase(unittest.TestCase):
"credit-6-account": "4611", "credit-6-account": "4611",
"notes": "wonderful"}) "notes": "wonderful"})
self.assertEqual(response.status_code, 302) self.assertEqual(response.status_code, 302)
self.assertNotEqual(response.headers["Location"],
"/accounting/transactions/income/create?r=/ok")
response = self.client.post( response = self.client.post(
"/accounting/transactions/transfer/create?r=/ok", "/accounting/transactions/transfer/create?r=/ok",
@ -126,3 +130,5 @@ class RunTestCase(unittest.TestCase):
"credit-6-account": "1111", "credit-6-account": "1111",
"notes": "nothing"}) "notes": "nothing"})
self.assertEqual(response.status_code, 302) self.assertEqual(response.status_code, 302)
self.assertNotEqual(response.headers["Location"],
"/accounting/transactions/transfer/create?r=/ok")