@@ -18,11 +18,6 @@ def test_accessible(self) -> None:
1818class PageNotFoundTestCase (TestCase ):
1919 url = "/does-not-exist/"
2020
21- def test_accessible (self ) -> None :
22- response = self .client .get (self .url )
23- self .assertEqual (response .status_code , 404 )
24- self .assertIn ("text/html" , response .headers ["content-type" ])
25-
2621 def test_accept_html (self ) -> None :
2722 response = self .client .get (self .url , headers = {"Accept" : "text/html" })
2823 self .assertEqual (response .status_code , 404 )
@@ -39,3 +34,26 @@ def test_simple_when_html_not_highest(self) -> None:
3934 )
4035 self .assertEqual (response .status_code , 404 )
4136 self .assertIn ("text/plain" , response .headers ["content-type" ])
37+
38+ def test_missing_accept_header (self ) -> None :
39+ response = self .client .get (self .url , headers = {"Accept" : "" })
40+ self .assertEqual (response .status_code , 404 )
41+ self .assertIn ("text/plain" , response .headers ["content-type" ])
42+
43+ def test_wildcard_accept_header (self ) -> None :
44+ response = self .client .get (self .url , headers = {"Accept" : "*/*" })
45+ self .assertEqual (response .status_code , 404 )
46+ self .assertIn ("text/plain" , response .headers ["content-type" ])
47+
48+ def test_browser_request (self ) -> None :
49+ """
50+ Test Accept header from Firefox 128
51+ """
52+ response = self .client .get (
53+ self .url ,
54+ headers = {
55+ "Accept" : "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8" # noqa:E501
56+ },
57+ )
58+ self .assertEqual (response .status_code , 404 )
59+ self .assertIn ("text/html" , response .headers ["content-type" ])
0 commit comments