Skip to content
Myr

More testcaseeees :)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

--HG-- branch : trunk

authored by Armin Ronacher · committed by Armin Ronacher · parent 744bb0a · Browse files · 1 file+17 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+17 added−4 removed

  • other:+17 added−4 removed

1 file+17 added−4 removed

modified:jinja2/testsuite/ext.py+17 added-4 removed
306 unmodified lines
307 assert tmpl.render(x=1) == '&lt;x&gt;1<y>'308309 def test_volatile_scoping(self):310 env = Environment(extensions=['jinja2.ext.autoescape'])311 tmpl = env.from_string('''311 tmplsource = '''312 {% autoescape val %}313 {% macro foo(x) %}314 [{{ x }}]315 {% endmacro %}316 {{ foo().__class__.__name__ }}317 {% endautoescape %}318 {{ '<testing>' }}319 '''318 ''')319 assert tmpl.render(val=True).strip() == 'Markup'320 assert tmpl.render(val=False).strip() == unicode.__name__320 tmpl = env.from_string(tmplsource)321 assert tmpl.render(val=True).split()[0] == 'Markup'322 assert tmpl.render(val=False).split()[0] == unicode.__name__323324 # looking at the source we should see <testing> there in raw325 # (and then escaped as well)326 env = Environment(extensions=['jinja2.ext.autoescape'])327 pysource = env.compile(tmplsource, raw=True)328 assert '<testing>\\n' in pysource329330 env = Environment(extensions=['jinja2.ext.autoescape'],331 autoescape=True)332 pysource = env.compile(tmplsource, raw=True)333 assert '&lt;testing&gt;\\n' in pysource334335336def suite():337 suite = unittest.TestSuite()338 suite.addTest(unittest.makeSuite(ExtensionsTestCase))339 suite.addTest(unittest.makeSuite(InternationalizationTestCase))
2 unmodified lines