From 75bc5bc634e90d5ccd2d7fc324df878dc5d4ce5d Mon Sep 17 00:00:00 2001 From: Craig Oldford Date: Mon, 13 Apr 2015 12:27:30 -0300 Subject: Fixed #12199 -- Added the ability to use "as" with the firstof template tag. --- tests/template_tests/syntax_tests/test_firstof.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/template_tests/syntax_tests') diff --git a/tests/template_tests/syntax_tests/test_firstof.py b/tests/template_tests/syntax_tests/test_firstof.py index 2c227f2304..a3c8c83151 100644 --- a/tests/template_tests/syntax_tests/test_firstof.py +++ b/tests/template_tests/syntax_tests/test_firstof.py @@ -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, '') -- cgit v1.3