Tests apps.get_app_config().
(self)
| 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): |
nothing calls this directly
no test coverage detected