feat: 계절 이야기에 사진 연결 (띠·목록·상세·피드, CC BY 계열 출처 표기)

This commit is contained in:
minaChoi committed 2026-10-08 09:10:10 +09:00
1 parent e8382f450b
commit ba62e82f1b
15 files changed
+77 -21

No files matched your search

+14
View File
@@ -2,8 +2,10 @@ from datetime import timedelta
import pytest
from httpx import ASGITransport, AsyncClient
from sqlalchemy import text
import services.season_service as season_service
from common.database.db_session_manager import DB_SESSION_MNG
from common.utils.kma_time import now_kst
from router.router import app
@@ -38,3 +40,15 @@ async def test_article_detail_and_not_found():
missing = (await client.get("/v1/season/article/9999")).json()
assert first["body"] and first["article"]["title"] == listed[0]["title"]
assert missing["result"]["desc"] == "NOT_FOUND"
@pytest.mark.anyio
async def test_article_photo_only_when_seeded():
async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as client:
listed = {a["code"]: a for a in (await client.get("/v1/season/article/list")).json()["articles"]}
umbrella = (await client.get(f"/v1/season/article/{listed['umbrella']['article_id']}")).json()["article"]
_, maple_id = await DB_SESSION_MNG.execute_lambda(lambda s: s.scalar(text("SELECT article_id FROM article WHERE code = 'maple'")))
maple = (await client.get(f"/v1/season/article/{maple_id}")).json()["article"]
assert umbrella["image"] == "/season/umbrella.jpg" and "image_credit" not in umbrella
assert maple["image"] == "/season/maple.jpg" and maple["image_credit"] == "ⓒJoycekim77 · CC BY-SA 3.0"
assert "image" not in listed["howgak"] and "image" not in listed["di"]