def test_error_handlers_404(self): self.assertTrue(handler404.endswith('.page_not_found')) c = Client() request = c.get("/abc") response = page_not_found(request) self.assertEqual(request.status_code, response.status_code) self.assertIn('404', unicode(response))
def test_error_handlers(self): self.assertTrue(handler404.endswith(".page_not_found")) self.assertTrue(handler500.endswith(".internal_server_error")) c = Client() request = c.get("/abc") response = page_not_found(request) self.assertEqual(response.status_code, 404) response = internal_server_error(request) self.assertEqual(response.status_code, 500)
def test_error_handlers(self): self.assertTrue(handler404.endswith('.page_not_found')) self.assertTrue(handler500.endswith('.internal_server_error')) c = Client() request = c.get("/abc") response = page_not_found(request) self.assertEqual(response.status_code, 404) self.assertIn('Error 404', unicode(response)) response = internal_server_error(request) self.assertEqual(response.status_code, 500) self.assertIn('Error 500', unicode(response))