From: Thomas van Noort Date: Fri, 22 Nov 2013 12:50:51 +0000 (+0100) Subject: Define tests for equalto. X-Git-Tag: 2.8~101^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=40367c48bb6b6354efb09ea2a92ec4e5bbe89559;p=thirdparty%2Fjinja.git Define tests for equalto. --- diff --git a/jinja2/testsuite/tests.py b/jinja2/testsuite/tests.py index 3ece7a8f..7e38e69b 100644 --- a/jinja2/testsuite/tests.py +++ b/jinja2/testsuite/tests.py @@ -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 }}')