Client portal auth (Phase 1): per-project link + password gate #63

Merged
serversdown merged 21 commits from feat/portal-auth into dev 2026-06-16 14:59:58 -04:00
Showing only changes of commit 33069a070d - Show all commits
+1 -5
View File
@@ -1,6 +1,5 @@
"""Test harness: a throwaway SQLite DB per test, get_db overridden, a TestClient """Test harness: a throwaway SQLite DB per test, get_db overridden, a TestClient
that does NOT run lifespan startup (so schedulers/SLMM polling stay off).""" that does NOT run lifespan startup (so schedulers/SLMM polling stay off)."""
import os
import uuid import uuid
import pytest import pytest
from datetime import datetime from datetime import datetime
@@ -30,15 +29,12 @@ def db_session(tmp_path):
def client(db_session): def client(db_session):
from backend.main import app # imported lazily so module side effects are contained from backend.main import app # imported lazily so module side effects are contained
def _override(): def _override():
try:
yield db_session yield db_session
finally:
pass
app.dependency_overrides[get_db] = _override app.dependency_overrides[get_db] = _override
# No `with` → lifespan/startup events do not run (no scheduler/SLMM threads). # No `with` → lifespan/startup events do not run (no scheduler/SLMM threads).
c = TestClient(app) c = TestClient(app)
yield c yield c
app.dependency_overrides.clear() app.dependency_overrides.pop(get_db, None)
@pytest.fixture(autouse=True) @pytest.fixture(autouse=True)