MCPcopy
hub / github.com/django/django / test_get_app_config

Method test_get_app_config

tests/apps/tests.py:160–175  ·  view source on GitHub ↗

Tests apps.get_app_config().

(self)

Source from the content-addressed store, hash-verified

158
159 @override_settings(INSTALLED_APPS=SOME_INSTALLED_APPS)
160 def test_get_app_config(self):
161 """
162 Tests apps.get_app_config().
163 """
164 app_config = apps.get_app_config("admin")
165 self.assertEqual(app_config.name, "django.contrib.admin")
166
167 app_config = apps.get_app_config("staticfiles")
168 self.assertEqual(app_config.name, "django.contrib.staticfiles")
169
170 with self.assertRaises(LookupError):
171 apps.get_app_config("admindocs")
172
173 msg = "No installed app with label 'django.contrib.auth'. Did you mean 'myauth'"
174 with self.assertRaisesMessage(LookupError, msg):
175 apps.get_app_config("django.contrib.auth")
176
177 @override_settings(INSTALLED_APPS=SOME_INSTALLED_APPS)
178 def test_is_installed(self):

Callers

nothing calls this directly

Calls 2

get_app_configMethod · 0.80
assertRaisesMessageMethod · 0.80

Tested by

no test coverage detected