mirror of
https://github.com/django/django.git
synced 2025-06-05 03:29:12 +00:00
[1.5.x] Fixed #17787 -- Documented reset caches by setting_changed signal
Backport of fc2681b22 from master.
This commit is contained in:
parent
cb2817543f
commit
c5da577b9e
@ -1586,15 +1586,23 @@ The decorator can also be applied to test case classes::
|
|||||||
the original ``LoginTestCase`` is still equally affected by the
|
the original ``LoginTestCase`` is still equally affected by the
|
||||||
decorator.
|
decorator.
|
||||||
|
|
||||||
.. note::
|
When overriding settings, make sure to handle the cases in which your app's
|
||||||
|
code uses a cache or similar feature that retains state even if the
|
||||||
|
setting is changed. Django provides the
|
||||||
|
:data:`django.test.signals.setting_changed` signal that lets you register
|
||||||
|
callbacks to clean up and otherwise reset state when settings are changed.
|
||||||
|
|
||||||
When overriding settings, make sure to handle the cases in which your app's
|
Django itself uses this signal to reset various data:
|
||||||
code uses a cache or similar feature that retains state even if the
|
|
||||||
setting is changed. Django provides the
|
=========================== ========================
|
||||||
:data:`django.test.signals.setting_changed` signal that lets you register
|
Overriden settings Data reset
|
||||||
callbacks to clean up and otherwise reset state when settings are changed.
|
=========================== ========================
|
||||||
Note that this signal isn't currently used by Django itself, so changing
|
USE_TZ, TIME_ZONE Databases timezone
|
||||||
built-in settings may not yield the results you expect.
|
TEMPLATE_CONTEXT_PROCESSORS Context processors cache
|
||||||
|
TEMPLATE_LOADERS Template loaders cache
|
||||||
|
SERIALIZATION_MODULES Serializers cache
|
||||||
|
LOCALE_PATHS, LANGUAGE_CODE Default translation and loaded translations
|
||||||
|
=========================== ========================
|
||||||
|
|
||||||
Emptying the test outbox
|
Emptying the test outbox
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
Loading…
x
Reference in New Issue
Block a user