Merged the "init-db" console command to the Flask application initialization in the test site, to simplify the code.

This commit is contained in:
2023-04-10 23:50:16 +08:00
parent c21ed59dfe
commit 700e4f822a
11 changed files with 32 additions and 56 deletions

View File

@ -42,11 +42,7 @@ class ConsoleCommandTestCase(unittest.TestCase):
"""
self.app: Flask = create_test_app()
runner: FlaskCliRunner = self.app.test_cli_runner()
with self.app.app_context():
result: Result = runner.invoke(args="init-db")
self.assertEqual(result.exit_code, 0,
result.output + str(result.exception))
# Drop every accounting table, to see if accounting-init recreates
# them correctly.
tables: list[sa.Table] \