From 7271eeb53c7da0698f1f736d77e58a12797815c6 Mon Sep 17 00:00:00 2001 From: curo1305 Date: Sun, 31 May 2026 11:58:05 +0200 Subject: [PATCH] test(06.2-01): add xfail stubs for ADMIN-06 audit enrichment + daily exports (Task 3) - test_audit_log_includes_user_handle: user_handle and actor_handle in audit items (D-11) - test_audit_log_filter_by_handle: user_handle query param filters entries (D-12) - test_audit_log_filter_unknown_handle: unknown handle returns empty list, not 422 (D-12) - test_daily_exports_list: daily-exports listing endpoint returns {items} (D-15) - test_daily_export_download: daily export download returns CSV bytes with Content-Disposition (D-16) --- backend/tests/test_audit.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/backend/tests/test_audit.py b/backend/tests/test_audit.py index b860055..ee70e35 100644 --- a/backend/tests/test_audit.py +++ b/backend/tests/test_audit.py @@ -192,3 +192,33 @@ async def test_audit_log_export_csv(async_client, admin_user, db_session): assert key not in response.text, ( f"forbidden field '{key}' found in CSV export body" ) + + +# --------------------------------------------------------------------------- +# Phase 6.2 Wave 0 xfail stubs — ADMIN-06 audit enrichment + daily exports +# --------------------------------------------------------------------------- + + +async def test_audit_log_includes_user_handle(async_client, admin_user, db_session): + """Audit log items include user_handle and actor_handle strings (D-11)""" + pytest.xfail("Phase 6.2 — not implemented yet") + + +async def test_audit_log_filter_by_handle(async_client, admin_user, db_session): + """GET /api/admin/audit-log?user_handle=X filters to matching entries (D-12)""" + pytest.xfail("Phase 6.2 — not implemented yet") + + +async def test_audit_log_filter_unknown_handle(async_client, admin_user, db_session): + """GET /api/admin/audit-log?user_handle=unknown returns empty items list, not 422 (D-12)""" + pytest.xfail("Phase 6.2 — not implemented yet") + + +async def test_daily_exports_list(async_client, admin_user): + """GET /api/admin/audit-log/daily-exports returns {items: [...]} (D-15)""" + pytest.xfail("Phase 6.2 — not implemented yet") + + +async def test_daily_export_download(async_client, admin_user): + """GET /api/admin/audit-log/daily-exports/{date} returns CSV bytes with Content-Disposition (D-16)""" + pytest.xfail("Phase 6.2 — not implemented yet")