diff options
| author | Preston Timmons <preston.timmons@rewardstyle.com> | 2016-01-21 21:50:06 -0600 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-01-22 15:35:28 -0500 |
| commit | c00ae7f58c34962ed6dbec4eb8aaf747da59ed2f (patch) | |
| tree | b3985f7262b60ff43ca6f0e7bc4c84b2d25a915e /tests/template_tests/syntax_tests | |
| parent | a08d2463d2674b95f5a995f77cd9596168378a4f (diff) | |
Fixed #26118 -- Added 'is' operator to if template tag.
Diffstat (limited to 'tests/template_tests/syntax_tests')
| -rw-r--r-- | tests/template_tests/syntax_tests/test_if.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/template_tests/syntax_tests/test_if.py b/tests/template_tests/syntax_tests/test_if.py index 92b3f16351..507a26b0b7 100644 --- a/tests/template_tests/syntax_tests/test_if.py +++ b/tests/template_tests/syntax_tests/test_if.py @@ -527,3 +527,13 @@ class IfTagTests(SimpleTestCase): # A single equals sign is a syntax error. with self.assertRaises(TemplateSyntaxError): self.engine.render_to_string('if-tag-single-eq', {'foo': 1}) + + @setup({'template': '{% if foo is True %}yes{% else %}no{% endif %}'}) + def test_if_is_match(self): + output = self.engine.render_to_string('template', {'foo': True}) + self.assertEqual(output, 'yes') + + @setup({'template': '{% if foo is True %}yes{% else %}no{% endif %}'}) + def test_if_is_no_match(self): + output = self.engine.render_to_string('template', {'foo': 1}) + self.assertEqual(output, 'no') |
