forked from admin/miem_workers
51 lines
1.9 KiB
Python
51 lines
1.9 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 "На странице: {{ value }}" in template
|
|
assert "{% for value in [25, 50, 100] %}" 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
|
|
|
|
|
|
def test_runs_template_links_to_run_detail():
|
|
template = Path("app/templates/runs.html").read_text(encoding="utf-8")
|
|
|
|
assert 'href="/admin/runs/{{ run.id }}"' in template
|
|
|
|
|
|
def test_run_detail_template_extends_base_and_shows_change_groups():
|
|
template = Path("app/templates/run_detail.html").read_text(encoding="utf-8")
|
|
|
|
assert '{% extends "base.html" %}' in template
|
|
assert "Новые сотрудники" in template
|
|
assert "Потеряшки" in template
|
|
assert "Уволенные" in template
|
|
assert "Детализация сотрудников для этого запуска недоступна" in template
|