diff --git a/backend/tests/test_sky_api.py b/backend/tests/test_sky_api.py index 659a887..5f5ddec 100644 --- a/backend/tests/test_sky_api.py +++ b/backend/tests/test_sky_api.py @@ -49,7 +49,8 @@ async def test_sky_view_scores_three_days_with_spots(monkeypatch, clean): assert body["sunset"]["confidence"] == 1 assert len(body["days"]) == 3 assert [s["name"] for s in body["spots"]] == ["망원한강공원", "선유도공원", "하늘공원"] - assert 255 <= body["sunset_azimuth"] <= 280 + # 서울 해 지는 방위는 한 해 동안 240°(동지)~300°(하지) 사이 + assert 240 <= body["sunset_azimuth"] <= 300 plan = body["plan"] assert plan["verdict"] == "go" and plan["headline"] == "나가 볼 만해요" and plan["when"] in ("오늘", "내일") assert "적당히" in plan["reason"] diff --git a/backend/tests/test_weather_today.py b/backend/tests/test_weather_today.py index ee64eb9..c1ee9f6 100644 --- a/backend/tests/test_weather_today.py +++ b/backend/tests/test_weather_today.py @@ -8,7 +8,9 @@ from sqlalchemy import text import services.weather_service as weather_service from common.cache.redis_client import REDIS from common.database.db_session_manager import DB_SESSION_MNG -from common.utils.kma_time import kst_midnight, latest_vilage_base, now_kst +from common.utils.kma_time import KST, kst_midnight, latest_vilage_base, now_kst +from crud.region_crud import RegionCRUD +from services.calc.sun import sun_times from services.external.kma import day_start_base from router.router import app @@ -57,7 +59,11 @@ async def test_today_fetches_stores_and_returns_8_slots(monkeypatch, clean_regio assert [s["label"] for s in body["slots"]] == ["0시", "3시", "6시", "9시", "12시", "15시", "18시", "21시"] assert all(s["temp_c"] == 18 for s in body["slots"]) assert body["slots"][0]["icon"] == "moon" - assert body["slots"][6]["icon"] == "sunset" and body["slots"][6]["note"] == "노을" + # 해 지는 시각이 든 3시간 칸이 노을 (여름엔 18시 칸, 늦가을·겨울엔 15시 칸) + _, region = await DB_SESSION_MNG.execute_lambda(lambda s: RegionCRUD().get(s, REGION)) + at = sun_times(now_kst().date(), float(region.lat), float(region.lon)).sunset_at.astimezone(KST) + dusk = body["slots"][at.hour // 3] + assert dusk["icon"] == "sunset" and dusk["note"] == "노을" assert len(calls) == 2 diff --git a/frontend/seo/foliage_2026.json b/frontend/seo/foliage_2026.json index fb2b69d..e56cc22 100644 --- a/frontend/seo/foliage_2026.json +++ b/frontend/seo/foliage_2026.json @@ -547,16 +547,6 @@ "basis": "가장 가까운 산림청 예측 지점(수리산, 단풍나무류) 날짜", "coord_point": "경복궁" }, - { - "name": "남이섬", - "kind": "ginkgo", - "region": "강원 춘천", - "lat": 37.79627, - "lon": 127.52549, - "peak": "2026-10-27", - "basis": "가장 가까운 산림청 예측 지점(강원도립화목원, 은행나무) 날짜", - "coord_point": "남이섬" - }, { "name": "덕수궁 돌담길", "kind": "ginkgo", diff --git a/frontend/src/b/FoliagePage.tsx b/frontend/src/b/FoliagePage.tsx index 5134820..b88ef90 100644 --- a/frontend/src/b/FoliagePage.tsx +++ b/frontend/src/b/FoliagePage.tsx @@ -52,7 +52,7 @@ function Marker({ p, sel }: { p: Pt; sel: boolean }) { ) } -/** 단풍 지도 페이지: 명소 68곳을 지도에서 확대해 보고 목록으로 고른다. 한 손가락은 확대 전엔 페이지 스크롤, 확대 뒤엔 지도 이동 */ +/** 단풍 지도 페이지: 명소 67곳을 지도에서 확대해 보고 목록으로 고른다. 한 손가락은 확대 전엔 페이지 스크롤, 확대 뒤엔 지도 이동 */ export function FoliagePage() { const navigate = useNavigate() const [params] = useSearchParams() diff --git a/frontend/src/b/foliage.ts b/frontend/src/b/foliage.ts index 77fbc83..d4da2af 100644 --- a/frontend/src/b/foliage.ts +++ b/frontend/src/b/foliage.ts @@ -52,7 +52,7 @@ export const PROVINCES = ( export const md = (iso: string) => `${Number(iso.slice(5, 7))}/${Number(iso.slice(8, 10))}` const province = (m: Spot) => m.region.split(' ')[0].split('·') -/** 오늘(한국 시각) 기준 명소 68곳과 단계. 단풍철이 아니면 inSeason 이 false */ +/** 오늘(한국 시각) 기준 명소 67곳과 단계. 단풍철이 아니면 inSeason 이 false */ export function useFoliage() { const [today] = useState(() => { const t = kst(new Date())