Private
Public Access
1
0
Files
rowsandall/rowers/tests/test_errorpages.py
2019-01-15 17:31:46 +01:00

23 lines
797 B
Python

#from __future__ import print_function
from statements import *
#@pytest.mark.django_db
class TestErrorPages(TestCase):
def test_error_handlers(self):
self.assertTrue(urls.handler404.endswith('.error404_view'))
self.assertTrue(urls.handler500.endswith('.error500_view'))
factory = RequestFactory()
request = factory.get('/')
response = error404_view(request)
self.assertEqual(response.status_code, 404)
self.assertIn('404 Page not found', unicode(response))
response = error500_view(request)
self.assertEqual(response.status_code, 500)
self.assertIn('500 Internal Server Error', unicode(response))
response = error400_view(request)
self.assertEqual(response.status_code, 400)