test: add Market Score methodology page tests
Subtask 6/6: 8 tests covering EN/DE 200 status, legacy 301 redirect, JSON-LD schema types, FAQ sections, OG tags, footer link. Add footer_market_score to i18n parity allowlist (branded term). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -57,6 +57,8 @@ _IDENTICAL_VALUE_ALLOWLIST = {
|
|||||||
# Business plan — Indoor/Outdoor same in DE, financial abbreviations
|
# Business plan — Indoor/Outdoor same in DE, financial abbreviations
|
||||||
"bp_indoor", "bp_outdoor",
|
"bp_indoor", "bp_outdoor",
|
||||||
"bp_lbl_ebitda", "bp_lbl_irr", "bp_lbl_moic", "bp_lbl_opex",
|
"bp_lbl_ebitda", "bp_lbl_irr", "bp_lbl_moic", "bp_lbl_opex",
|
||||||
|
# Market Score — branded term kept in English in DE
|
||||||
|
"footer_market_score",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
59
web/tests/test_market_score.py
Normal file
59
web/tests/test_market_score.py
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
"""Tests for the Market Score methodology page."""
|
||||||
|
|
||||||
|
|
||||||
|
async def test_en_returns_200(client):
|
||||||
|
resp = await client.get("/en/market-score")
|
||||||
|
assert resp.status_code == 200
|
||||||
|
text = await resp.get_data(as_text=True)
|
||||||
|
assert "Market Score" in text
|
||||||
|
assert "padelnomics" in text
|
||||||
|
|
||||||
|
|
||||||
|
async def test_de_returns_200(client):
|
||||||
|
resp = await client.get("/de/market-score")
|
||||||
|
assert resp.status_code == 200
|
||||||
|
text = await resp.get_data(as_text=True)
|
||||||
|
assert "Market Score" in text
|
||||||
|
assert "padelnomics" in text
|
||||||
|
|
||||||
|
|
||||||
|
async def test_legacy_redirect(client):
|
||||||
|
resp = await client.get("/market-score")
|
||||||
|
assert resp.status_code == 301
|
||||||
|
assert resp.headers["Location"].endswith("/en/market-score")
|
||||||
|
|
||||||
|
|
||||||
|
async def test_contains_jsonld(client):
|
||||||
|
resp = await client.get("/en/market-score")
|
||||||
|
text = await resp.get_data(as_text=True)
|
||||||
|
assert '"@type": "WebPage"' in text
|
||||||
|
assert '"@type": "FAQPage"' in text
|
||||||
|
assert '"@type": "BreadcrumbList"' in text
|
||||||
|
|
||||||
|
|
||||||
|
async def test_contains_faq_section(client):
|
||||||
|
resp = await client.get("/en/market-score")
|
||||||
|
text = await resp.get_data(as_text=True)
|
||||||
|
assert "Frequently Asked Questions" in text
|
||||||
|
assert "<details" in text
|
||||||
|
|
||||||
|
|
||||||
|
async def test_de_contains_faq_section(client):
|
||||||
|
resp = await client.get("/de/market-score")
|
||||||
|
text = await resp.get_data(as_text=True)
|
||||||
|
assert "Häufig gestellte Fragen" in text
|
||||||
|
|
||||||
|
|
||||||
|
async def test_contains_og_tags(client):
|
||||||
|
resp = await client.get("/en/market-score")
|
||||||
|
text = await resp.get_data(as_text=True)
|
||||||
|
assert 'og:title' in text
|
||||||
|
assert 'og:description' in text
|
||||||
|
|
||||||
|
|
||||||
|
async def test_footer_has_market_score_link(client):
|
||||||
|
resp = await client.get("/en/market-score")
|
||||||
|
text = await resp.get_data(as_text=True)
|
||||||
|
assert "/en/market-score" in text
|
||||||
|
# Footer should link to market score page
|
||||||
|
assert "Market Score" in text
|
||||||
Reference in New Issue
Block a user