Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #20032 -- Documented how to simulate the absence of a setting

Thanks Ram Rachum for the report.
  • Loading branch information...
commit 50eb70b08fae48445a52680b2d07a9535b25e3c5 1 parent e4d9f8a
@claudep claudep authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 docs/topics/testing/overview.txt
View
8 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
Please sign in to comment.
Something went wrong with that request. Please try again.