It is a common practice for apps to use a single settings dictionary for
their own configuration. A quick example can be seen here with the django-
auth-adfs package: https://github.com/hodossy/django-auth-adfs at commit
e11eca87ef96a3a074fc0846feb71183182e53dd.
To reproduce the issue, you can clone the project, install dependecies and
run 'python manage.py test' to see test failing with KeyError due to above
error.
--
Ticket URL: <https://code.djangoproject.com/ticket/30871>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* version: 2.2 => master
* resolution: => invalid
Comment:
Thanks for this report, however it is not a valid usage of the
`override_settings()` decorator (see
[https://docs.djangoproject.com/en/dev/topics/testing/tools/#django.test.override_settings
documentation]). You can simulate the absence of a setting, but you cannot
modify it partially with `override_settings()`. You should rather create a
local copy and override the setting e.g.
{{{
def test_access_callback_azure(self):
...
auth_adfs_setting = settings.AUTH_ADFS.copy()
del auth_adfs_setting["SERVER"]
with self.settings(AUTH_ADFS=auth_adfs_setting):
...
}}}
Closing per TicketClosingReasons/UseSupportChannels.
--
Ticket URL: <https://code.djangoproject.com/ticket/30871#comment:1>