fix: avoid Jinja dict items collision in employee card

This commit is contained in:
Anton
2026-04-29 11:34:46 +03:00
parent 26db5832fd
commit af87fa8af3
7 changed files with 12 additions and 9 deletions

View File

@@ -86,7 +86,7 @@ def test_employee_detail_payload_normalizes_human_readable_sections(db_session):
payload = employee_detail_payload(employee)
assert payload["contacts"]["emails"] == ["person@hse.ru"]
assert payload["contacts"]["items"] == ["consultation hours"]
assert payload["contacts"]["contact_items"] == ["consultation hours"]
assert payload["external_ids"][0]["system"] == "ORCID"
assert payload["sections"][0]["year_entries"][0]["text"] == "Master degree"
assert payload["sections"][1]["publications"][0]["title"] == "Paper"
@@ -111,6 +111,7 @@ def test_employee_payloads_tolerate_malformed_current_data(db_session):
assert display["positions"] == []
assert display["email_text"] == ""
assert detail["contacts"]["emails"] == []
assert detail["contacts"]["contact_items"] == []
assert detail["sections"] == []

View File

@@ -18,7 +18,7 @@ def test_health_returns_versions():
response = client.get("/api/health")
assert response.status_code == 200
assert response.json()["backend_version"] == "0.2.3"
assert response.json()["backend_version"] == "0.2.4"
def test_mcp_requires_token_and_lists_tools():

View File

@@ -7,6 +7,8 @@ def test_employee_detail_template_is_human_readable():
assert "Current data" not in template
assert "<pre class=\"code\"" not in template
assert ">Tabs<" not in template
assert "contacts.items" not in template
assert "contacts.contact_items" in template
assert "Основная информация" in template
assert "Контакты" in template
assert "Разделы профиля" in template