Skip to content
Myr

Added a testcase for #363. This bug was fixed along the way.

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 4ac4bdf · Browse files · 2 files+32 added−1 removed
This commit

State

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

Diff stats

2 files+32 added−1 removed

  • tests:+30 added−0 removed
  • other:+2 added−1 removed

2 files+32 added−1 removed

modified:tests/test_old_bugs.py+30 added
138 unmodified lines
139def test_empty_if_condition_fails():140 assert_raises(TemplateSyntaxError, Template, '{% if %}....{% endif %}')141 assert_raises(TemplateSyntaxError, Template, '{% if foo %}...{% elif %}...{% endif %}')142 assert_raises(TemplateSyntaxError, Template, '{% for x in %}..{% endfor %}')143144145def test_recursive_loop_bug():146 tpl1 = Template("""147 {% for p in foo recursive%}148 {{p.bar}}149 {% for f in p.fields recursive%}150 {{f.baz}}151 {{p.bar}}152 {% if f.rec %}153 {{ loop(f.sub) }}154 {% endif %}155 {% endfor %}156 {% endfor %}157 """)158 tpl1.render(ctx)159160 tpl2 = Template("""161 {% for p in foo%}162 {{p.bar}}163 {% for f in p.fields recursive%}164 {{f.baz}}165 {{p.bar}}166 {% if f.rec %}167 {{ loop(f.sub) }}168 {% endif %}169 {% endfor %}170 {% endfor %}171 """)172 tpl2.render(ctx)
modified:Makefile+2 added-1 removed
3 unmodified lines
42to3:5 rm -rf py3k6 mkdir py3k7 cp -R jinja2 py3k8 cp -R tests py3k8 2to3 jinja2 > py3k/convert.patch9 2to3 jinja2 tests > py3k/convert.patch10 cd py3k; patch -p0 < convert.patch1112.PHONY: test