diff options
author | Mads Jensen <mje@inducks.org> | 2017-05-28 21:37:21 +0200 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2017-07-29 19:07:23 -0400 |
commit | a51c4de1945be2225f20fad794cfb52d8f1f9236 (patch) | |
tree | 36386b70a27cf027a8a491de319c3e59e0d3d0cd /tests/apps | |
parent | 38988f289f7f5708f5ea85de2d5dfe0d86b23106 (diff) | |
download | django-a51c4de1945be2225f20fad794cfb52d8f1f9236.tar.gz |
Used assertRaisesMessage() to test Django's error messages.
Diffstat (limited to 'tests/apps')
-rw-r--r-- | tests/apps/tests.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/apps/tests.py b/tests/apps/tests.py index 50b3927434..2910220b94 100644 --- a/tests/apps/tests.py +++ b/tests/apps/tests.py @@ -53,7 +53,8 @@ class AppsTests(SimpleTestCase): """ Tests when INSTALLED_APPS contains an incorrect app config. """ - with self.assertRaises(ImproperlyConfigured): + msg = "'apps.apps.BadConfig' must supply a name attribute." + with self.assertRaisesMessage(ImproperlyConfigured, msg): with self.settings(INSTALLED_APPS=['apps.apps.BadConfig']): pass @@ -61,7 +62,8 @@ class AppsTests(SimpleTestCase): """ Tests when INSTALLED_APPS contains a class that isn't an app config. """ - with self.assertRaises(ImproperlyConfigured): + msg = "'apps.apps.NotAConfig' isn't a subclass of AppConfig." + with self.assertRaisesMessage(ImproperlyConfigured, msg): with self.settings(INSTALLED_APPS=['apps.apps.NotAConfig']): pass |