1
0
mirror of https://github.com/django/django.git synced 2025-01-19 23:02:20 +00:00
django/tests/backends/test_utils.py
Claude Paroz c716fe8782 Refs #23919 -- Removed six.PY2/PY3 usage
Thanks Tim Graham for the review.
2017-01-18 16:21:28 +01:00

16 lines
589 B
Python

from django.core.exceptions import ImproperlyConfigured
from django.db.utils import load_backend
from django.test import SimpleTestCase
class TestLoadBackend(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"
" 'mysql', 'oracle', 'postgresql', 'sqlite3'\n"
"Error was: No module named 'foo'"
)
with self.assertRaisesMessage(ImproperlyConfigured, msg):
load_backend('foo')