MCPcopy
hub / github.com/django/django / assertImproperlyConfigured

Method assertImproperlyConfigured

tests/db_utils/tests.py:25–35  ·  view source on GitHub ↗
(self, DATABASES)

Source from the content-addressed store, hash-verified

23 self.assertImproperlyConfigured(DATABASES)
24
25 def assertImproperlyConfigured(self, DATABASES):
26 conns = ConnectionHandler(DATABASES)
27 self.assertEqual(
28 conns[DEFAULT_DB_ALIAS].settings_dict["ENGINE"], "django.db.backends.dummy"
29 )
30 msg = (
31 "settings.DATABASES is improperly configured. Please supply the "
32 "ENGINE value. Check settings documentation for more details."
33 )
34 with self.assertRaisesMessage(ImproperlyConfigured, msg):
35 conns[DEFAULT_DB_ALIAS].ensure_connection()
36
37 def test_no_default_database(self):
38 DATABASES = {"other": {}}

Calls 3

ConnectionHandlerClass · 0.90
assertRaisesMessageMethod · 0.80
ensure_connectionMethod · 0.80

Tested by

no test coverage detected