diff --git a/yunke-server/tests/test_analytics_api.py b/yunke-server/tests/test_analytics_api.py index 2e35991..b76fab0 100644 --- a/yunke-server/tests/test_analytics_api.py +++ b/yunke-server/tests/test_analytics_api.py @@ -84,6 +84,11 @@ async def test_overview_endpoint(make_client, monkeypatch): "/api/analytics/overview", params={"channel": "wechat", "scope": "year"} ) assert r2.status_code == 422 + # channel 非法 → 422(同一 Literal 校验路径) + r3 = await client.get( + "/api/analytics/overview", params={"channel": "sms", "scope": "today"} + ) + assert r3.status_code == 422 async def test_overview_unmapped_accounts(make_client, monkeypatch):