summaryrefslogtreecommitdiff
path: root/tests/template_tests/utils.py
diff options
context:
space:
mode:
authorOla Sitarska <ola@sitarska.com>2014-12-01 21:20:37 +0000
committerTim Graham <timograham@gmail.com>2015-01-11 15:21:01 -0500
commitd563e3be68369694a3bac1efd7779d8e03bb6a51 (patch)
tree0b53bdc3d55bfe0a78d25a3fb2006f02fa9fa326 /tests/template_tests/utils.py
parent412066e71e81e899bca63523f239e56138ec9e9d (diff)
Fixed #23913 -- Deprecated the `=` comparison in `if` template tag.
Diffstat (limited to 'tests/template_tests/utils.py')
-rw-r--r--tests/template_tests/utils.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/template_tests/utils.py b/tests/template_tests/utils.py
index 3c37be18e4..588c1a4096 100644
--- a/tests/template_tests/utils.py
+++ b/tests/template_tests/utils.py
@@ -18,7 +18,7 @@ from django.utils.safestring import mark_safe
ROOT = os.path.dirname(os.path.abspath(upath(__file__)))
-def setup(templates, *args):
+def setup(templates, *args, **kwargs):
"""
Runs test method multiple times in the following order:
@@ -31,6 +31,9 @@ def setup(templates, *args):
True False
True True
"""
+ # when testing deprecation warnings, it's useful to run just one test since
+ # the message won't be displayed multiple times
+ test_once = kwargs.get('test_once', False)
for arg in args:
templates.update(arg)
@@ -57,6 +60,8 @@ def setup(templates, *args):
loaders=loaders,
)
func(self)
+ if test_once:
+ return
func(self)
self.engine = Engine(