summaryrefslogtreecommitdiff
path: root/tests/db_utils
diff options
context:
space:
mode:
authorBenjy Weinberger <benjyw@gmail.com>2018-12-16 10:09:08 -0800
committerTim Graham <timograham@gmail.com>2019-01-09 10:58:37 -0500
commit222caab68a2a7345043d0c50161203cb2cfe70eb (patch)
tree72d7f70c4945c8c76b30d7e772422e64efc894d3 /tests/db_utils
parentc2c85663e2dd06c9ed9c9ec2d02202d6d668d7f0 (diff)
Fixed #30071 -- Fixed error message when a 'default' database isn't provided.
Diffstat (limited to 'tests/db_utils')
-rw-r--r--tests/db_utils/tests.py7
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):