mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-04 22:02:16 +02:00
refactor(auth): replace user variable with auth context in integration and unit tests
This commit is contained in:
parent
14cb0a22e9
commit
af5a112212
9 changed files with 86 additions and 56 deletions
|
|
@ -42,7 +42,7 @@ Maximize logic covered by unit tests; keep integration tests for what genuinely
|
|||
|
||||
`conftest.py` is scoped to its directory and below. Keep truly global fixtures in `tests/conftest.py`; put module-specific fixtures in that module's `conftest.py` so a DB fixture never loads for a pure unit test.
|
||||
|
||||
For API integration tests, override `get_async_session` and `current_active_user` to ride the test's transactional `db_session` (see `tests/integration/notifications/conftest.py`): rows seeded in the test and rows read via the endpoint share one transaction that rolls back automatically.
|
||||
For API integration tests, override `get_async_session` and `get_auth_context` to ride the test's transactional `db_session` (see `tests/integration/notifications/conftest.py`): rows seeded in the test and rows read via the endpoint share one transaction that rolls back automatically.
|
||||
|
||||
## Import mode
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue