diff options
author | Tim Graham <timograham@gmail.com> | 2017-01-24 08:33:26 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-24 08:33:26 -0500 |
commit | a87d6b69a75d0f9a66652e3f0bd1c2c85624c7d5 (patch) | |
tree | 3e722414876e97365244a9986fc64bb80a746370 /tests/backends/test_utils.py | |
parent | 435e4bf38e97255acd97eacadeb8fe312ba97aff (diff) | |
download | django-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.py | 6 |
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'") |