Files
padelnomics/web/tests/test_i18n_tips.py
Deeman aa7a8bad99 test: sync i18n tests to current translation values
- wiz_summary_label DE: "Aktuelle Werte" → "Aktuelle Zusammenfassung"
- add mscore_reife_chip + mscore_potenzial_chip to identical-value allowlist (branded product names)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 21:24:37 +01:00

112 lines
2.8 KiB
Python

"""
Tests for i18n tip key completeness.
Regression for: "i" tooltip spans showing untranslated English text in the
German planner because tip_* keys were missing from the DE translation dict.
Also covers wiz_summary_label used in the wizard preview summary bar.
"""
import pytest
from padelnomics.i18n import get_translations
EN = get_translations("en")
DE = get_translations("de")
# Every key that a slider tip or inline tooltip now references via t.tip_*
TIP_KEYS = [
"wiz_summary_label",
"tip_permits_compliance",
"tip_dbl_courts",
"tip_sgl_courts",
"tip_sqm_dbl_hall",
"tip_sqm_sgl_hall",
"tip_sqm_dbl_outdoor",
"tip_sqm_sgl_outdoor",
"tip_rate_peak",
"tip_rate_offpeak",
"tip_rate_single",
"tip_peak_pct",
"tip_booking_fee",
"tip_util_target",
"tip_hours_per_day",
"tip_days_indoor",
"tip_days_outdoor",
"tip_membership_rev",
"tip_fb_rev",
"tip_coaching_rev",
"tip_retail_rev",
"tip_glass_type",
"tip_court_cost_dbl",
"tip_court_cost_sgl",
"tip_hall_cost_sqm",
"tip_foundation_sqm",
"tip_land_price_sqm",
"tip_hvac",
"tip_electrical",
"tip_sanitary",
"tip_fire_protection",
"tip_planning",
"tip_floor_prep",
"tip_hvac_upgrade",
"tip_lighting_upgrade",
"tip_fitout",
"tip_outdoor_foundation",
"tip_outdoor_site_work",
"tip_outdoor_lighting",
"tip_outdoor_fencing",
"tip_working_capital",
"tip_contingency",
"tip_budget_target",
"tip_rent_sqm",
"tip_outdoor_rent",
"tip_property_tax",
"tip_insurance",
"tip_electricity",
"tip_heating",
"tip_water",
"tip_maintenance",
"tip_cleaning",
"tip_marketing",
"tip_staff",
"tip_loan_pct",
"tip_interest_rate",
"tip_loan_term",
"tip_construction_months",
"tip_hold_years",
"tip_exit_multiple",
"tip_annual_rev_growth",
]
@pytest.mark.parametrize("key", TIP_KEYS)
def test_key_present_in_english(key):
assert key in EN, f"Missing EN translation key: {key}"
@pytest.mark.parametrize("key", TIP_KEYS)
def test_key_present_in_german(key):
assert key in DE, f"Missing DE translation key: {key}"
@pytest.mark.parametrize("key", TIP_KEYS)
def test_english_value_non_empty(key):
assert EN[key], f"Empty EN value for: {key}"
@pytest.mark.parametrize("key", TIP_KEYS)
def test_german_value_non_empty(key):
assert DE[key], f"Empty DE value for: {key}"
@pytest.mark.parametrize("key", TIP_KEYS)
def test_german_differs_from_english(key):
"""Every tooltip must be translated, not just copied from English."""
assert EN[key] != DE[key], f"DE translation identical to EN for: {key}"
def test_wiz_summary_label_english_value():
assert EN["wiz_summary_label"] == "Live Summary"
def test_wiz_summary_label_german_value():
assert DE["wiz_summary_label"] == "Aktuelle Zusammenfassung"