mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Fixed #12199 -- Added the ability to use "as" with the firstof template tag.
This commit is contained in:
parent
6023312dde
commit
75bc5bc634
4 changed files with 31 additions and 4 deletions
|
@ -81,3 +81,10 @@ class FirstOfTagTests(SimpleTestCase):
|
|||
def test_firstof14(self):
|
||||
output = self.engine.render_to_string('firstof14', {'a': '<'})
|
||||
self.assertEqual(output, '<')
|
||||
|
||||
@setup({'firstof15': '{% firstof a b c as myvar %}'})
|
||||
def test_firstof15(self):
|
||||
ctx = {'a': 0, 'b': 2, 'c': 3}
|
||||
output = self.engine.render_to_string('firstof15', ctx)
|
||||
self.assertEqual(ctx['myvar'], '2')
|
||||
self.assertEqual(output, '')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue