Added a testcase for add_extension
authorArmin Ronacher <armin.ronacher@active-4.com>
Sat, 29 May 2010 20:03:29 +0000 (22:03 +0200)
committerArmin Ronacher <armin.ronacher@active-4.com>
Sat, 29 May 2010 20:03:29 +0000 (22:03 +0200)
--HG--
branch : trunk

jinja2/testsuite/ext.py

index 98e4161a80e59c94305125b9c3c6875c1d95a676..f97853d12a41f10393fc04ac9f30d7533c27cbca 100644 (file)
@@ -158,6 +158,12 @@ class StreamFilterExtension(Extension):
 
 class ExtensionsTestCase(JinjaTestCase):
 
+    def test_extend_late(self):
+        env = Environment()
+        env.add_extension('jinja2.ext.autoescape')
+        t = env.from_string('{% autoescape true %}{{ "<test>" }}{% endautoescape %}')
+        assert t.render() == '&lt;test&gt;'
+
     def test_loop_controls(self):
         env = Environment(extensions=['jinja2.ext.loopcontrols'])