Fixed #32197 -- Improved error message when loading a database backend fails.

This commit is contained in:
Hasan Ramezani 2020-11-15 21:34:35 +01:00 committed by Mariusz Felisiak
parent 464a4c0c59
commit 4cce1d13cf
2 changed files with 7 additions and 4 deletions

View file

@ -57,8 +57,9 @@ class LoadBackendTests(SimpleTestCase):
def test_load_backend_invalid_name(self):
msg = (
"'foo' isn't an available database backend.\n"
"Try using 'django.db.backends.XXX', where XXX is one of:\n"
"'foo' isn't an available database backend or couldn't be "
"imported. Check the above exception. To use one of the built-in "
"backends, use 'django.db.backends.XXX', where XXX is one of:\n"
" 'mysql', 'oracle', 'postgresql', 'sqlite3'"
)
with self.assertRaisesMessage(ImproperlyConfigured, msg) as cm: