diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/db_utils/tests.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/db_utils/tests.py b/tests/db_utils/tests.py index a6cfb43667..db58b58f33 100644 --- a/tests/db_utils/tests.py +++ b/tests/db_utils/tests.py @@ -31,6 +31,13 @@ class ConnectionHandlerTests(SimpleTestCase): with self.assertRaisesMessage(ImproperlyConfigured, msg): conns[DEFAULT_DB_ALIAS].ensure_connection() + def test_no_default_database(self): + DATABASES = {'other': {}} + conns = ConnectionHandler(DATABASES) + msg = "You must define a 'default' database." + with self.assertRaisesMessage(ImproperlyConfigured, msg): + conns['other'].ensure_connection() + class DatabaseErrorWrapperTests(TestCase): |
