If contrib.auth is not in INSTALLED_APPS, any import (even indirectly) of anything within contrib.auth causes Django to fail to startup
|Reported by:||carljm||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Description (last modified by carljm)
This is due to d818e0c9b2b88276cc499974f9eee893170bf0a8 (the new checks framework) and the new stricter app-loading stuff. It also relates to #20915 (the dependency that django.test has on django.contrib.auth) and #19774 (the dependency that django.contrib.contenttypes has on django.contrib.admin and thus indirectly on django.contrib.auth).
The check_user_model check for contrib.auth is registered in django/contrib/auth/__init__.py as a side effect of importing anything from within django.contrib.auth.
Actually executing the check_user_model check when contrib.auth is not installed results in "LookupError: No installed app with label 'auth'." on the cls = apps.get_model(app_name, model_name) line.
Change History (11)
comment:6 Changed 15 months ago by charettes
comment:7 Changed 15 months ago by carljm
- Description modified (diff)
- Summary changed from Cannot run tests without contrib.auth in INSTALLED_APPS to If contrib.auth is not in INSTALLED_APPS, any import (even indirectly) of anything within contrib.auth causes Django to fail to startup