浏览代码

Fixed #22071 -- Added a warning regarding override_settings and aliasing.

Thanks EvilDMP for the suggestion.
Henk Vos 11 年之前
父节点
当前提交
e65c0ccac0
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      docs/topics/testing/tools.txt

+ 4 - 0
docs/topics/testing/tools.txt

@@ -1181,6 +1181,10 @@ The decorator can also be applied to test case classes::
     the session backend in a test that uses cached sessions and overrides
     :setting:`CACHES`.
 
+    Finally, avoid aliasing your settings as module-level constants as
+    ``override_settings()`` won't work on such values since they are
+    only evaluated the first time the module is imported.
+
 You can also simulate the absence of a setting by deleting it after settings
 have been overridden, like this::