Merge branch 'feature/variety-item' into main
This commit is contained in:
commit
1bcee68432
18 files changed
+416
-20
No files matched your search
@@ -136,6 +136,29 @@ async def test_no_unique_content_blocks_publish(auth_headers, client):
|
||||
assert r["gate"]["reason"] == PublishRejectReason.NO_UNIQUE_CONTENT.name
|
||||
|
||||
|
||||
async def test_owner_written_intro_counts_as_unique_content(auth_headers, client):
|
||||
"""검증: fact·FAQ·사진 설명은 없지만 사장님이 소개 섹션 본문을 직접 썼다.
|
||||
기대결과: 실제 발행본에 표시되는 소개문 1건으로 계수되어 발행된다."""
|
||||
h = await auth_headers("owner-intro")
|
||||
pid = await _place(client, h, "직접소개펜션")
|
||||
for k, v in {**REQUIRED, "cancel_policy": "X"}.items():
|
||||
await client.post(f"/v1/place/{pid}/fact", headers=h, json={"key": k, "value": v})
|
||||
await client.post(f"/v1/place/{pid}/site/theme", headers=h, json={"theme": {"sections": [{
|
||||
"id": "intro", "name": "소개", "enabled": True, "locked": False,
|
||||
"body": "하조대의 아침 바다를 조용히 바라볼 수 있는 작은 숙소입니다.",
|
||||
}]}})
|
||||
|
||||
job_id = (await client.post(
|
||||
f"/v1/place/{pid}/site/build", headers=h, json={"publish": True}
|
||||
)).json()["job_id"]
|
||||
await _run()
|
||||
|
||||
r = (await client.get(f"/v1/job/{job_id}", headers=h)).json()["job"]["result"]
|
||||
assert r["gate"]["passed"] is True
|
||||
assert r["unique_content_count"] == 1
|
||||
assert r["published"] is True
|
||||
|
||||
|
||||
async def test_missing_required_field_warns_but_publishes(auth_headers, client, db_engine):
|
||||
"""검증: 취소 규정 없이 빌드한다.
|
||||
|
||||
|
||||
@@ -79,6 +79,12 @@ def test_zero_unique_content_blocks_publish():
|
||||
assert check_unique_content(1).passed is True
|
||||
|
||||
|
||||
def test_unmeasured_unique_content_is_not_zero():
|
||||
"""검증: 렌더러가 계수를 못 재고(None) 실패했다.
|
||||
기대결과: 통과 — 디스크·번들 오류에 NO_UNIQUE_CONTENT 라는 엉뚱한 사유가 붙으면 안 된다."""
|
||||
assert check_unique_content(None).passed is True
|
||||
|
||||
|
||||
def test_jsonld_mismatch_blocks_publish():
|
||||
"""검증: 구조화 데이터 값이 화면 값과 다르다.
|
||||
기대결과: ★ 규칙 3 — JSONLD_MISMATCH 로 거부. 검색엔진에만 다른 말을 하면 안 된다."""
|
||||
|
||||
@@ -222,6 +222,18 @@ def test_owner_disabled_section_stays_disabled():
|
||||
assert next(s for s in theme["sections"] if s["id"] == "photos")["enabled"] is False
|
||||
|
||||
|
||||
def test_owner_written_section_body_reaches_publish_payload():
|
||||
"""검증: 에디터에서 직접 쓴 소개 본문.
|
||||
기대결과: 발행 payload 에 그대로 남는다 — 저장만 되고 경계에서 버려지면 발행본과 계수에 못 쓴다."""
|
||||
theme = _payload_theme({"sections": [{
|
||||
"id": "intro", "name": "소개", "enabled": True, "locked": False,
|
||||
"body": "바다를 보며 조용히 쉬어가는 작은 숙소입니다.",
|
||||
}]})
|
||||
assert next(s for s in theme["sections"] if s["id"] == "intro")["body"] == (
|
||||
"바다를 보며 조용히 쉬어가는 작은 숙소입니다."
|
||||
)
|
||||
|
||||
|
||||
def test_partial_colors_are_filled_from_category_default():
|
||||
"""검증: 저장된 색이 일부 키만 담고 있을 때.
|
||||
기대결과: 빠진 자리는 업종 기본이 메운다 — 렌더러 타입이 6개를 모두 요구하므로
|
||||
|
||||
Reference in new issue
Block a user