File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,11 @@ def test_page_not_found(self):
47
47
for url in self .nonexistent_urls :
48
48
response = self .client .get (url )
49
49
self .assertEqual (response .status_code , 404 )
50
+ self .assertIn (b'<h1>Not Found</h1>' , response .content )
51
+ self .assertIn (
52
+ b'<p>The requested resource was not found on this server.</p>' ,
53
+ response .content ,
54
+ )
50
55
51
56
@override_settings (TEMPLATES = [{
52
57
'BACKEND' : 'django.template.backends.django.DjangoTemplates' ,
@@ -71,7 +76,7 @@ def test_csrf_token_in_404(self):
71
76
def test_server_error (self ):
72
77
"The server_error view raises a 500 status"
73
78
response = self .client .get ('/server_error/' )
74
- self .assertEqual (response . status_code , 500 )
79
+ self .assertContains (response , b'<h1>Server Error (500)</h1>' , status_code = 500 )
75
80
76
81
def test_bad_request (self ):
77
82
request = self .request_factory .get ('/' )
You can’t perform that action at this time.
0 commit comments