fix(06): CR-07 update test to use event_type prefix instead of full type
The test_audit_log_filter_by_event_type test was passing the full event
type string ("document.uploaded") as the event_type filter parameter.
Update to pass the validated prefix ("document") matching the new
allowlist semantics, and assert item event_type starts with "document."
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
21366bd288
commit
fb4ce293ae
@@ -131,7 +131,7 @@ async def test_audit_log_filter_by_event_type(async_client, admin_user, db_sessi
|
|||||||
|
|
||||||
response = await async_client.get(
|
response = await async_client.get(
|
||||||
"/api/admin/audit-log",
|
"/api/admin/audit-log",
|
||||||
params={"event_type": "document.uploaded"},
|
params={"event_type": "document"},
|
||||||
headers=admin_user["headers"],
|
headers=admin_user["headers"],
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -139,9 +139,9 @@ async def test_audit_log_filter_by_event_type(async_client, admin_user, db_sessi
|
|||||||
body = response.json()
|
body = response.json()
|
||||||
assert body["total"] >= 1, "expected at least one filtered result"
|
assert body["total"] >= 1, "expected at least one filtered result"
|
||||||
|
|
||||||
# Every returned item must match the filter
|
# Every returned item must match the filter prefix
|
||||||
for item in body["items"]:
|
for item in body["items"]:
|
||||||
assert item["event_type"] == "document.uploaded", (
|
assert item["event_type"].startswith("document."), (
|
||||||
f"filter returned unexpected event_type: {item['event_type']}"
|
f"filter returned unexpected event_type: {item['event_type']}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user