mirror of
https://github.com/django/django.git
synced 2025-07-24 05:36:15 +00:00
Fixed #23913 -- Deprecated the =
comparison in if
template tag.
This commit is contained in:
parent
412066e71e
commit
d563e3be68
6 changed files with 68 additions and 3 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue