Permalink
Browse files

Define tests for equalto.

  • Loading branch information...
1 parent 9c89bbb commit 40367c48bb6b6354efb09ea2a92ec4e5bbe89559 Thomas van Noort committed Nov 22, 2013
Showing with 11 additions and 0 deletions.
  1. +11 −0 jinja2/testsuite/tests.py
View
@@ -72,6 +72,17 @@ def test_upper(self):
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 }}')

0 comments on commit 40367c4

Please sign in to comment.