mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Tidied djang.db.utils.load_backend().
Removed an unneeded EnvironmentError catching and used "raise from exc" syntax.
This commit is contained in:
parent
435e4bf38e
commit
a87d6b69a7
2 changed files with 14 additions and 18 deletions
|
@ -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'")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue