Added the "accounting-init-db" console command to the database initialization of the test site, for simplicity.
This commit is contained in:
@@ -21,9 +21,7 @@ import unittest
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
import httpx
|
||||
from click.testing import Result
|
||||
from flask import Flask
|
||||
from flask.testing import FlaskCliRunner
|
||||
|
||||
from test_site import db
|
||||
from testlib import NEXT_URI, Accounts, create_test_app, get_client
|
||||
@@ -49,12 +47,8 @@ class OptionTestCase(unittest.TestCase):
|
||||
"""
|
||||
self.app: Flask = create_test_app()
|
||||
|
||||
runner: FlaskCliRunner = self.app.test_cli_runner()
|
||||
with self.app.app_context():
|
||||
from accounting.models import Option
|
||||
result: Result = runner.invoke(
|
||||
args=["accounting-init-db", "-u", "editor"])
|
||||
self.assertEqual(result.exit_code, 0)
|
||||
Option.query.delete()
|
||||
|
||||
self.client, self.csrf_token = get_client(self.app, "admin")
|
||||
|
||||
Reference in New Issue
Block a user