diff --git a/backend/tests/test_watch.py b/backend/tests/test_watch.py index 0f51b5b..9c9ab0a 100644 --- a/backend/tests/test_watch.py +++ b/backend/tests/test_watch.py @@ -47,6 +47,8 @@ def test_timeline_skips_weak_tomorrow_or_finished_sunset(): @pytest.mark.anyio async def test_watch_summary_bundles_now_top_picks_sunset(offline): + # 행사는 스케줄러가 7일마다 모아 둔다. 요청은 DB 만 읽으니 먼저 모아 둔다 + await week_service.collect_events("11", now_kst().date()) async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as client: body = (await client.get("/v1/watch/summary", params={"region": REGION, "pick": "laundry, nope,running,carwash,bike"})).json() assert body["result"]["success"] is True @@ -70,6 +72,7 @@ async def test_watch_summary_puts_live_event_first_without_bracket_prefix(offlin {"contentid": "1", "title": "내일 축제", "addr1": "서울", "eventstartdate": day(1), "eventenddate": day(2)}, {"contentid": "2", "title": "[주최] 열리는 축제", "addr1": "서울", "eventstartdate": day(-3), "eventenddate": day(2)}, ] if sido == "11" else [])) + await week_service.collect_events("11", today) async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as client: body = (await client.get("/v1/watch/summary", params={"region": REGION})).json() assert [e["name"] for e in body["events"]] == ["열리는 축제", "내일 축제"]