Refactor database module and add testing utilities

Simplify database module by re-organizing engine creation, session handling, and removing redundant methods. Introduce SQLite compatibility for testing and add a utility module for test database setup and teardown. Integrate initial unit tests for user models and update dependencies for security and testing.
This commit is contained in:
2025-02-28 12:31:10 +01:00
parent 5cd38c82e0
commit 5f9a63dd07
7 changed files with 140 additions and 124 deletions

9
backend/pytest.ini Normal file
View File

@@ -0,0 +1,9 @@
[pytest]
env =
IS_TEST=True
testpaths = tests
python_files = test_*.py
addopts = --disable-warnings
markers =
sqlite: marks tests that should run on SQLite (mocked).
postgres: marks tests that require a real PostgreSQL database.