Files
Jyotisha/tests/test_report_no_source_lines_2115.py
T
ClaudeandClaude Opus 5.5 223c90ca0c
Independent Staging Quality Gate / validate-frontend (push) Successful in 6m20s
Independent Staging Quality Gate / validate-python (push) Successful in 7m37s
Independent Staging Quality Gate / publish (push) Successful in 2m47s
fix(report): drop the remaining 「来源」 lines and print birth-data source codes as reader words (BUG-2115 follow-up)
Annual clock captions no longer end with "this report's native calculation";
the general dasha reference drops its per-lord study-notes citation; the birth
data section translates user_reported / family_exact and the other stored codes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXp2U3BH1SxwAGyhhbe1
2026-11-21 11:35:24 +08:00

26 lines
1.2 KiB
Python

"""BUG-2115: the reader's report carries no library names and no 「来源」 lines (owner, 2026-11-21)."""
from __future__ import annotations
from scripts.report_render.dasha_reference import render_dasha_reference
from scripts.report_render.upstream_sync_chapters import _word
def test_dasha_reference_has_no_source_line() -> None:
zh = render_dasha_reference("zh")
en = render_dasha_reference("en")
assert "### " in zh and "### " in en
assert "来源:" not in zh and "读书笔记" not in zh and "PDF 页" not in zh
assert "Source:" not in en and "PDF page" not in en
def test_birth_provenance_codes_are_reader_words() -> None:
for code in ("user_reported", "family_exact", "family_clear", "family_vague", "hospital_record",
"id_document", "approximate", "period_only", "unknown", "legacy_import", "caller_supplied"):
zh = _word(code, "zh")
en = _word(code, "en")
assert "_" not in zh and not any("a" <= char <= "z" for char in zh), (code, zh)
assert "_" not in en and en != "—", (code, en)
assert _word("user_reported", "zh") == "用户填写"
assert _word("family_exact", "zh") == "家人记得的确切时间"