33 lines
1.2 KiB
Python
33 lines
1.2 KiB
Python
from pathlib import Path
|
|
|
|
|
|
def test_base_navigation_is_russian_and_has_no_legacy_employees_link():
|
|
template = Path("app/templates/base.html").read_text(encoding="utf-8")
|
|
|
|
assert "Обзор" in template
|
|
assert "Сотрудники" in template
|
|
assert "Запуски" in template
|
|
assert "Выйти" in template
|
|
assert ">Employees<" not in template
|
|
assert "/admin/employees" not in template
|
|
|
|
|
|
def test_directory_template_is_russian_and_uses_display_dates():
|
|
template = Path("app/templates/directory.html").read_text(encoding="utf-8")
|
|
|
|
assert "Сотрудники" in template
|
|
assert "Колонки" in template
|
|
assert "Применить" in template
|
|
assert "Найдено:" in template
|
|
assert "employee.first_seen_display" in template
|
|
assert "employee.last_seen_display" in template
|
|
assert "employee.dismissed_display" in template
|
|
assert "Directory" not in template
|
|
assert "employees found" not in template
|
|
|
|
|
|
def test_admin_employees_route_redirects_to_directory():
|
|
source = Path("app/admin.py").read_text(encoding="utf-8")
|
|
|
|
assert 'RedirectResponse("/admin/directory", status_code=303)' in source
|