from pathlib import Path def test_templates_do_not_slice_filter_results_inline(): template_dir = Path("webui/app/templates") offenders = [] for template in template_dir.glob("*.html"): content = template.read_text() if "| default(" in content and ")[" in content: offenders.append(str(template)) assert offenders == [] def test_search_template_does_not_require_browser_api_client(): content = Path("webui/app/templates/search.html").read_text() assert "window.docsApiClient" not in content assert "{% for result in results %}" in content