@@ -18,11 +18,6 @@ def test_accessible(self) -> None:
18
18
class PageNotFoundTestCase (TestCase ):
19
19
url = "/does-not-exist/"
20
20
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
-
26
21
def test_accept_html (self ) -> None :
27
22
response = self .client .get (self .url , headers = {"Accept" : "text/html" })
28
23
self .assertEqual (response .status_code , 404 )
@@ -39,3 +34,26 @@ def test_simple_when_html_not_highest(self) -> None:
39
34
)
40
35
self .assertEqual (response .status_code , 404 )
41
36
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