mirror of
https://github.com/django/django.git
synced 2025-08-30 15:27:40 +00:00
Fixed db.utils.load_backend() on non-ASCII paths.
This commit is contained in:
parent
2f6bdab159
commit
28ee511b7e
2 changed files with 5 additions and 6 deletions
|
@ -1,17 +1,16 @@
|
|||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.db.utils import load_backend
|
||||
from django.test import SimpleTestCase
|
||||
from django.test.utils import str_prefix
|
||||
from django.utils import six
|
||||
|
||||
|
||||
class TestLoadBackend(SimpleTestCase):
|
||||
def test_load_backend_invalid_name(self):
|
||||
msg = str_prefix(
|
||||
msg = (
|
||||
"'foo' isn't an available database backend.\n"
|
||||
"Try using 'django.db.backends.XXX', where XXX is one of:\n"
|
||||
" %(_)s'mysql', %(_)s'oracle', %(_)s'postgresql_psycopg2', %(_)s'sqlite3'\n"
|
||||
"Error was: No module named %%s"
|
||||
" 'mysql', 'oracle', 'postgresql_psycopg2', 'sqlite3'\n"
|
||||
"Error was: No module named %s"
|
||||
) % "foo.base" if six.PY2 else "'foo'"
|
||||
with self.assertRaisesMessage(ImproperlyConfigured, msg):
|
||||
load_backend('foo')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue