summaryrefslogtreecommitdiff
path: root/docs/topics/testing
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2013-03-13 23:11:35 +0100
committerClaude Paroz <claude@2xlibre.net>2013-03-13 23:14:26 +0100
commit50eb70b08fae48445a52680b2d07a9535b25e3c5 (patch)
tree7cb1960c9b62881a070c8d35ed5c3be2aa4858a9 /docs/topics/testing
parente4d9f8aed11e964885cd77f8abd01ba0dfa4aa13 (diff)
Fixed #20032 -- Documented how to simulate the absence of a setting
Thanks Ram Rachum for the report.
Diffstat (limited to 'docs/topics/testing')
-rw-r--r--docs/topics/testing/overview.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/docs/topics/testing/overview.txt b/docs/topics/testing/overview.txt
index b917086e06..cb1c8dc52a 100644
--- a/docs/topics/testing/overview.txt
+++ b/docs/topics/testing/overview.txt
@@ -1415,6 +1415,14 @@ The decorator can also be applied to test case classes::
the original ``LoginTestCase`` is still equally affected by the
decorator.
+You can also simulate the absence of a setting by deleting it after settings
+have been overriden, like this::
+
+ @override_settings()
+ def test_something(self):
+ del settings.LOGIN_URL
+ ...
+
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