forked from yvv/decision
Auth : mode prototype factice en prod + fix test DB manquante
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/push/woodpecker Pipeline failed
- Login : panneau proto-mode en avant quand DEMO_MODE actif (profils API) masque le formulaire extension-required ; note trustWallet à venir - auth.ts : TODO trustWallet avec protocole postMessage prévu - routers/auth.py : TODO trustWallet au point de vérification signature - test_middleware : fixture _create_tables (autouse) — ASGITransport ne déclenche pas le lifespan, init_db() ne tournait pas → duniter_identities introuvable au verify ; 224/224 passent Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -14,8 +14,21 @@ from __future__ import annotations
|
||||
import pytest
|
||||
from httpx import ASGITransport, AsyncClient
|
||||
|
||||
import app.models # noqa: F401 — registers all models with Base.metadata before create_all
|
||||
from app.database import init_db
|
||||
from app.main import app
|
||||
|
||||
|
||||
@pytest.fixture(scope="module", autouse=True)
|
||||
async def _create_tables():
|
||||
"""Create DB tables once for this module.
|
||||
|
||||
ASGITransport does not trigger the FastAPI lifespan, so init_db() would
|
||||
never run. Tests that hit endpoints backed by the DB need the tables to
|
||||
exist beforehand.
|
||||
"""
|
||||
await init_db()
|
||||
|
||||
ORIGIN = "http://localhost:3002"
|
||||
CHALLENGE_URL = "/api/v1/auth/challenge"
|
||||
VERIFY_URL = "/api/v1/auth/verify"
|
||||
|
||||
Reference in New Issue
Block a user