Added a new testcase for something that is supposed to be a bug.
authorArmin Ronacher <armin.ronacher@active-4.com>
Sun, 14 Mar 2010 23:03:25 +0000 (00:03 +0100)
committerArmin Ronacher <armin.ronacher@active-4.com>
Sun, 14 Mar 2010 23:03:25 +0000 (00:03 +0100)
--HG--
branch : trunk

jinja2/testsuite/core_tags.py

index e4d105a6ce32cf0853fe14bd167b3a69c1932a58..d456b4f9c983eb91a13f79a6d0ddc0e7a4e38baa 100644 (file)
@@ -271,6 +271,12 @@ class MacrosTestCase(JinjaTestCase):
         assert tmpl.module.bar.catch_varargs
         assert tmpl.module.baz.caller
 
+    def test_callself(self):
+        tmpl = self.env.from_string('{% macro foo(x) %}{{ x }}{% if x > 1 %}|'
+                                    '{{ foo(x - 1) }}{% endif %}{% endmacro %}'
+                                    '{{ foo(5) }}')
+        assert tmpl.render() == '5|4|3|2|1'
+
 
 def suite():
     suite = unittest.TestSuite()