mirror of
https://github.com/django/django.git
synced 2025-08-01 09:32:50 +00:00
Fixed #29060 -- Made {% firstof %} assign '' to the asvar if all inputs are false.
This commit is contained in:
parent
8dc675d90f
commit
d0b44c44ef
2 changed files with 13 additions and 5 deletions
|
@ -82,3 +82,10 @@ class FirstOfTagTests(SimpleTestCase):
|
|||
output = self.engine.render_to_string('firstof15', ctx)
|
||||
self.assertEqual(ctx['myvar'], '2')
|
||||
self.assertEqual(output, '')
|
||||
|
||||
@setup({'firstof16': '{% firstof a b c as myvar %}'})
|
||||
def test_all_false_arguments_asvar(self):
|
||||
ctx = {'a': 0, 'b': 0, 'c': 0}
|
||||
output = self.engine.render_to_string('firstof16', ctx)
|
||||
self.assertEqual(ctx['myvar'], '')
|
||||
self.assertEqual(output, '')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue