#25911 closed Bug (needsinfo)
The decorator override_settings resets SETTINGS_MODULE variable
Reported by: | Vitaliy Yelnik | Owned by: | nobody |
---|---|---|---|
Component: | Testing framework | Version: | 1.9 |
Severity: | Normal | Keywords: | override_settings |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
from django.conf import UserSettingsHolder, settings # output 'service.settings.local' print settings.SETTINGS_MODULE # from code override_settings override = UserSettingsHolder(settings._wrapped) # output None print override.SETTINGS_MODULE # output 'service.settings.local' print override.default_settings.SETTINGS_MODULE
Change History (7)
comment:1 by , 9 years ago
comment:2 by , 9 years ago
Resolution: | → needsinfo |
---|---|
Status: | new → closed |
comment:3 by , 9 years ago
I have because of this began to fall tests, as this variable is used in a third-party module
follow-up: 5 comment:4 by , 9 years ago
I'm not sure, but it might be viewed as intentional/correct behavior since if you're overriding some settings, you're no longer using the original settings module. I'd be interested to see how the third-party module is using the variable.
comment:5 by , 9 years ago
Replying to timgraham:
I'm not sure, but it might be viewed as intentional/correct behavior since if you're overriding some settings, you're no longer using the original settings module. I'd be interested to see how the third-party module is using the variable.
Coffin: Jinja2 extensions for Django
URLExtension class, line 205
comment:6 by , 9 years ago
I don't find that usage a compelling reason to fix this ticket as it's based on a common convention (but not a requirement) of the structure a Django project. Also, reversing URLs by dotted path is deprecated and removed in Django 1.10.
Could you elaborate on why this is a problem?