mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #12199 -- Added the ability to use "as" with the firstof template tag.
This commit is contained in:
committed by
Tim Graham
parent
6023312dde
commit
75bc5bc634
@@ -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, '')
|
||||
|
||||
Reference in New Issue
Block a user