diff --git a/tests/test_custom_pages.py b/tests/test_custom_pages.py index bd2c427b..871dd69c 100644 --- a/tests/test_custom_pages.py +++ b/tests/test_custom_pages.py @@ -25,6 +25,9 @@ def custom_pages_client(tmp_path_factory): '{{ custom_header("x-this-is-bar", "bar") }}BAR', "utf-8", ) + (pages_dir / "atom.html").write_text( + '{{ custom_header("content-type", "application/xml") }}', "utf-8", + ) (pages_dir / "redirect.html").write_text( '{{ custom_redirect("/example") }}', "utf-8" ) @@ -68,6 +71,13 @@ def test_custom_headers(custom_pages_client): assert "FOOBAR" == response.text +def test_custom_content_type(custom_pages_client): + response = custom_pages_client.get("/atom") + assert 200 == response.status + assert response.headers["content-type"] == "application/xml" + assert "" == response.text + + def test_redirect(custom_pages_client): response = custom_pages_client.get("/redirect", allow_redirects=False) assert 302 == response.status