#17787 closed Bug (fixed)
Clear setting-dependant caches when settings are overridden (in tests)
| Reported by: | Aymeric Augustin | Owned by: | Claude Paroz |
|---|---|---|---|
| Component: | Testing framework | Version: | 1.4-beta-1 |
| Severity: | Release blocker | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
r16237 introduced a setting_changed signal, triggered by the override_settings decorator / context manager.
However, Django doesn't use this signal to reset caches that depend on built-in settings. In the current state of thing, the signal is only usable is third-party code.
Is this a design choice or a bug?
Marking as release blocker since it's a major bug in a new feature.
Attachments (1)
Change History (18)
comment:1 by , 14 years ago
| Owner: | changed from to |
|---|
comment:2 by , 14 years ago
| Owner: | changed from to |
|---|---|
| Severity: | Release blocker → Normal |
| Triage Stage: | Design decision needed → Accepted |
comment:3 by , 14 years ago
It would be nice to add a note mentioning this limitation in the 1.4 docs.
comment:7 by , 14 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Several settings are now using the setting_changed signal. I don't think it's useful to get this one open.
comment:8 by , 14 years ago
| Resolution: | fixed |
|---|---|
| Status: | closed → reopened |
I'd like to review a few more settings :)
comment:9 by , 14 years ago
| Owner: | changed from to |
|---|---|
| Status: | reopened → new |
comment:11 by , 13 years ago
FYI,
Locale-related global state is now reset in 32a4df6c55f2efd020b7fbc44c858f61b07da17d (a fix for #18395). See https://github.com/django/django/blob/master/django/test/signals.py
follow-up: 13 comment:12 by , 13 years ago
| Owner: | changed from to |
|---|---|
| Severity: | Normal → Release blocker |
We're in an inconsistent state right now. Some settings are properly reset and others aren't; the docs still say that the signal isn't used.
I don't think I'm going to work on this exhaustively.
We still have to document the new behavior before the next release. At worst, open django/tests/signals.py, make a list of settings that are reset, and put that in the docs...
comment:13 by , 13 years ago
| Has patch: | set |
|---|
Replying to aaugustin:
We're in an inconsistent state right now. Some settings are properly reset and others aren't;
Let's create tickets for each setting unproperly reset. But auditing the code to relate settings with global cached variables might be something hard. I'm afraid only bugs will reveal those.
the docs still say that the signal isn't used.
We still have to document the new behavior before the next release. At worst, open django/tests/signals.py, make a list of settings that are reset, and put that in the docs...
I'm attaching a patch for updating the docs.
comment:14 by , 13 years ago
I just committed one more in c7f44ae085df3a270aa998cdedb56f36900cb9ef (TEMPLATE_LOADERS). Let's not forget it when committing.
comment:15 by , 13 years ago
| Owner: | changed from to |
|---|
comment:16 by , 13 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
We discussed this on IRC and determined that:
override_settingsdoesn't reach its full potential until thenoverride_settingsis useful, even without this, and we don't want to make too intrusive changes at this point