test(backend): exerce AlertSeverity comme enum plutot qu'une chaine dans les tests alerts
Backend / Lint, typage et tests (push) Successful in 1m8s

Le filtre severity passait par une chaine brute dans les tests, sans jamais
exercer le trajet reel AlertSeverity (enum) -> SQLAlchemy -> PostgreSQL.
This commit is contained in:
Johan LEROY
2026-09-16 14:43:27 +02:00
parent e13096c62a
commit 76fa90dfcb
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -10,6 +10,7 @@ from app.api.deps import get_alert_service, get_current_principal
from app.core.principal import Principal
from app.core.roles import AccountKind, Role
from app.models.energy import Alert
from app.schemas.alert import AlertSeverity
def principal(role: Role = Role.LECTEUR) -> Principal:
@@ -112,7 +113,7 @@ async def test_list_alerts_transmits_the_severity_filter(
await client.get("/api/v1/alerts?severity=critical")
assert service.appels == [(None, "critical")]
assert service.appels == [(None, AlertSeverity.CRITICAL)]
async def test_list_alerts_returns_422_for_an_unknown_severity(