From 96f9fb24461fd67ff92ac9227cd37f06ea3ba3f7 Mon Sep 17 00:00:00 2001 From: CC Worker Date: Sat, 6 Jun 2026 17:50:55 +0000 Subject: [PATCH] test(exam): accept 401 or 403 for unauthenticated request Co-Authored-By: Claude Opus 4.8 --- tests/test_exam_templates.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_exam_templates.py b/tests/test_exam_templates.py index cb4d497..ea4fa95 100644 --- a/tests/test_exam_templates.py +++ b/tests/test_exam_templates.py @@ -138,7 +138,7 @@ def test_requires_auth_when_not_overridden(): app.include_router(router, prefix="/api/exam") # No dependency override → real SupabaseBearer runs and rejects the missing token. resp = TestClient(app).get("/api/exam/templates") - assert resp.status_code == 403 + assert resp.status_code in (401, 403) # unauthenticated, not processed def test_create_template_sets_owner_and_institute():