summaryrefslogtreecommitdiff
path: root/tests/backends/test_utils.py
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2017-01-24 08:33:26 -0500
committerGitHub <noreply@github.com>2017-01-24 08:33:26 -0500
commita87d6b69a75d0f9a66652e3f0bd1c2c85624c7d5 (patch)
tree3e722414876e97365244a9986fc64bb80a746370 /tests/backends/test_utils.py
parent435e4bf38e97255acd97eacadeb8fe312ba97aff (diff)
downloaddjango-a87d6b69a75d0f9a66652e3f0bd1c2c85624c7d5.tar.gz
Tidied djang.db.utils.load_backend().
Removed an unneeded EnvironmentError catching and used "raise from exc" syntax.
Diffstat (limited to 'tests/backends/test_utils.py')
-rw-r--r--tests/backends/test_utils.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/backends/test_utils.py b/tests/backends/test_utils.py
index d158e2a5a2..165820edae 100644
--- a/tests/backends/test_utils.py
+++ b/tests/backends/test_utils.py
@@ -8,8 +8,8 @@ class TestLoadBackend(SimpleTestCase):
msg = (
"'foo' isn't an available database backend.\n"
"Try using 'django.db.backends.XXX', where XXX is one of:\n"
- " 'mysql', 'oracle', 'postgresql', 'sqlite3'\n"
- "Error was: No module named 'foo'"
+ " 'mysql', 'oracle', 'postgresql', 'sqlite3'"
)
- with self.assertRaisesMessage(ImproperlyConfigured, msg):
+ with self.assertRaisesMessage(ImproperlyConfigured, msg) as cm:
load_backend('foo')
+ self.assertEqual(str(cm.exception.__cause__), "No module named 'foo'")