(tmp_path: Path)
| 35 | |
| 36 | |
| 37 | def test_templates_autoescape(tmp_path: Path) -> None: |
| 38 | path = tmp_path / "index.html" |
| 39 | path.write_text("Hello, {{ name }}") |
| 40 | |
| 41 | templates = Jinja2Templates(directory=tmp_path) |
| 42 | template = templates.get_template("index.html") |
| 43 | assert ( |
| 44 | template.render(name="<script>alert('XSS')</script>") |
| 45 | == "Hello, <script>alert('XSS')</script>" |
| 46 | ) |
| 47 | |
| 48 | |
| 49 | def test_calls_context_processors(tmp_path: Path, test_client_factory: TestClientFactory) -> None: |
nothing calls this directly
no test coverage detected