From d8e0e30c4134d3b3edb994343577469d0fc5bc76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Wed, 8 Feb 2023 10:47:55 +0800 Subject: [PATCH] Revised the coding style in the test_init test of the BaseAccountCommandTestCase test case. --- tests/test_base_account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_base_account.py b/tests/test_base_account.py index 434d640..aaef457 100644 --- a/tests/test_base_account.py +++ b/tests/test_base_account.py @@ -68,9 +68,9 @@ class BaseAccountCommandTestCase(unittest.TestCase): runner: FlaskCliRunner = self.app.test_cli_runner() result: Result = runner.invoke(args="accounting-init-base") self.assertEqual(result.exit_code, 0) - with self.app.app_context(): accounts: list[BaseAccount] = BaseAccount.query.all() + self.assertEqual(len(accounts), len(data)) for account in accounts: self.assertIn(account.code, data)