1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #30071 -- Fixed error message when a 'default' database isn't provided.

This commit is contained in:
Benjy Weinberger
2018-12-16 10:09:08 -08:00
committed by Tim Graham
parent c2c85663e2
commit 222caab68a
2 changed files with 9 additions and 3 deletions

View File

@@ -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):