Add init options to skip data initialization and remove manual cleanup in test cases.

This commit is contained in:
2026-01-11 11:51:49 +08:00
parent 693c5890ca
commit d62e295dc6
11 changed files with 39 additions and 50 deletions

View File

@@ -65,15 +65,9 @@ class CurrencyTestCase(unittest.TestCase):
:return: None.
"""
self.__app: Flask = create_test_app()
self.__app: Flask = create_test_app(is_skip_currencies=True)
"""The Flask application."""
with self.__app.app_context():
from accounting.models import Currency, CurrencyL10n
CurrencyL10n.query.delete()
Currency.query.delete()
db.session.commit()
self.__client: httpx.Client = get_client(self.__app, "editor")
"""The user client."""
self.__csrf_token: str = get_csrf_token(self.__client)