1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Used assertRaisesMessage() to test Django's error messages.

This commit is contained in:
Mads Jensen
2017-05-28 21:37:21 +02:00
committed by Tim Graham
parent 38988f289f
commit a51c4de194
69 changed files with 448 additions and 173 deletions

View File

@@ -1067,7 +1067,12 @@ class NoRootUrlConfTests(SimpleTestCase):
"""Tests for handler404 and handler500 if ROOT_URLCONF is None"""
def test_no_handler_exception(self):
with self.assertRaises(ImproperlyConfigured):
msg = (
"The included URLconf 'None' does not appear to have any patterns "
"in it. If you see valid patterns in the file then the issue is "
"probably caused by a circular import."
)
with self.assertRaisesMessage(ImproperlyConfigured, msg):
self.client.get('/test/me/')