summaryrefslogtreecommitdiff
path: root/docs/topics
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2012-10-27 21:55:50 +0200
committerClaude Paroz <claude@2xlibre.net>2012-10-27 22:04:06 +0200
commitc5da577b9e394b3b4696e4f4ca495c82951b6678 (patch)
tree18318a4383eb9262d224fd3fded76840fc1cfce6 /docs/topics
parentcb2817543fed794d27ccc6f15304b735017e1dcd (diff)
[1.5.x] Fixed #17787 -- Documented reset caches by setting_changed signal
Backport of fc2681b22 from master.
Diffstat (limited to 'docs/topics')
-rw-r--r--docs/topics/testing.txt24
1 files changed, 16 insertions, 8 deletions
diff --git a/docs/topics/testing.txt b/docs/topics/testing.txt
index d0b2e7cdf9..7c25a8b3ff 100644
--- a/docs/topics/testing.txt
+++ b/docs/topics/testing.txt
@@ -1586,15 +1586,23 @@ The decorator can also be applied to test case classes::
the original ``LoginTestCase`` is still equally affected by the
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.
+
+Django itself uses this signal to reset various data:
- 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.
- Note that this signal isn't currently used by Django itself, so changing
- built-in settings may not yield the results you expect.
+=========================== ========================
+Overriden settings Data reset
+=========================== ========================
+USE_TZ, TIME_ZONE Databases timezone
+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
~~~~~~~~~~~~~~~~~~~~~~~~