]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
Define tests for equalto. 283/head
authorThomas van Noort <thomas@silkapp.com>
Fri, 22 Nov 2013 12:50:51 +0000 (13:50 +0100)
committerThomas van Noort <thomas@silkapp.com>
Fri, 22 Nov 2013 12:50:51 +0000 (13:50 +0100)
jinja2/testsuite/tests.py

index 3ece7a8ff71ddf03e7006a5bb450895521b19e94..7e38e69bb327a09be0176533c2b4df52d0ab802a 100644 (file)
@@ -72,6 +72,17 @@ class TestsTestCase(JinjaTestCase):
         tmpl = env.from_string('{{ "FOO" is upper }}|{{ "foo" is upper }}')
         assert tmpl.render() == 'True|False'
 
+    def test_equalto(self):
+        tmpl = env.from_string('{{ foo is equalto 12 }}|'
+                               '{{ foo is equalto 0 }}|'
+                               '{{ foo is equalto (3 * 4) }}|'
+                               '{{ bar is equalto "baz" }}|'
+                               '{{ bar is equalto "zab" }}|'
+                               '{{ bar is equalto ("ba" + "z") }}|'
+                               '{{ bar is equalto bar }}|'
+                               '{{ bar is equalto foo }}')
+        assert tmpl.render(foo=12, bar="baz") == 'True|False|True|True|False|True|True|False'
+
     def test_sameas(self):
         tmpl = env.from_string('{{ foo is sameas false }}|'
                                '{{ 0 is sameas false }}')