feat: filter employees by academic degree
This commit is contained in:
@@ -51,6 +51,45 @@ def test_employee_display_payload_extracts_common_fields(db_session):
|
||||
assert payload["first_seen_display"] != "Не указано"
|
||||
|
||||
|
||||
def test_list_employees_page_filters_and_displays_academic_degrees(db_session):
|
||||
db_session.add_all(
|
||||
[
|
||||
Employee(
|
||||
profile_key="staff:degree",
|
||||
canonical_url="https://www.hse.ru/staff/degree",
|
||||
full_name="Doctor",
|
||||
status="active",
|
||||
first_seen_at=datetime.now(timezone.utc),
|
||||
last_seen_at=datetime.now(timezone.utc),
|
||||
current_data={
|
||||
"sections": [
|
||||
{
|
||||
"title": "Образование и учёные степени",
|
||||
"year_entries": [{"year": 2020, "text": "Доктор технических наук"}],
|
||||
}
|
||||
]
|
||||
},
|
||||
),
|
||||
Employee(
|
||||
profile_key="staff:no-degree",
|
||||
canonical_url="https://www.hse.ru/staff/no-degree",
|
||||
full_name="Master",
|
||||
status="active",
|
||||
first_seen_at=datetime.now(timezone.utc),
|
||||
last_seen_at=datetime.now(timezone.utc),
|
||||
current_data={"sections": [{"title": "Образование", "items": ["Магистратура"]}]},
|
||||
),
|
||||
]
|
||||
)
|
||||
db_session.commit()
|
||||
|
||||
page = list_employees_page(db_session, has_academic_degree=True)
|
||||
|
||||
assert page["total"] == 1
|
||||
assert page["employees"][0]["full_name"] == "Doctor"
|
||||
assert page["employees"][0]["academic_degree_text"] == "Доктор технических наук"
|
||||
|
||||
|
||||
def test_employee_detail_payload_normalizes_human_readable_sections(db_session):
|
||||
employee = Employee(
|
||||
profile_key="staff:person",
|
||||
|
||||
@@ -22,7 +22,9 @@ def test_directory_template_is_russian_and_uses_display_dates():
|
||||
assert "На странице: {{ value }}" in template
|
||||
assert "{% for value in [25, 50, 100] %}" in template
|
||||
assert "Найдено:" in template
|
||||
assert "Новости" in template
|
||||
assert "Новости" in template
|
||||
assert "Есть учёная степень" in template
|
||||
assert 'data-column="academic_degree"' in template
|
||||
assert "employee.news_count" in template
|
||||
assert "employee.first_seen_display" in template
|
||||
assert "employee.last_seen_display" in template
|
||||
|
||||
Reference in New Issue
Block a user