@@ -110,11 +110,6 @@ def test_setting_theme_on_one_site_sets_it_on_multiple_sites(self):
110110class PageNotFoundTestCase (TestCase ):
111111 url = "/does-not-exist/"
112112
113- def test_accessible (self ) -> None :
114- response = self .client .get (self .url )
115- self .assertEqual (response .status_code , 404 )
116- self .assertIn ("text/html" , response .headers ["content-type" ])
117-
118113 def test_accept_html (self ) -> None :
119114 response = self .client .get (self .url , headers = {"Accept" : "text/html" })
120115 self .assertEqual (response .status_code , 404 )
@@ -131,3 +126,26 @@ def test_simple_when_html_not_highest(self) -> None:
131126 )
132127 self .assertEqual (response .status_code , 404 )
133128 self .assertIn ("text/plain" , response .headers ["content-type" ])
129+
130+ def test_missing_accept_header (self ) -> None :
131+ response = self .client .get (self .url , headers = {"Accept" : "" })
132+ self .assertEqual (response .status_code , 404 )
133+ self .assertIn ("text/plain" , response .headers ["content-type" ])
134+
135+ def test_wildcard_accept_header (self ) -> None :
136+ response = self .client .get (self .url , headers = {"Accept" : "*/*" })
137+ self .assertEqual (response .status_code , 404 )
138+ self .assertIn ("text/plain" , response .headers ["content-type" ])
139+
140+ def test_browser_request (self ) -> None :
141+ """
142+ Test Accept header from Firefox 128
143+ """
144+ response = self .client .get (
145+ self .url ,
146+ headers = {
147+ "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
148+ },
149+ )
150+ self .assertEqual (response .status_code , 404 )
151+ self .assertIn ("text/html" , response .headers ["content-type" ])
0 commit comments