

def test_scoped_loop_var(self):
    t = env.from_string('{% for x in seq %}{{ loop.first }}{% for y in seq %}{% endfor %}{% endfor %}')
    assert (t.render(seq='ab') == 'TrueFalse')
    t = env.from_string('{% for x in seq %}{% for y in seq %}{{ loop.first }}{% endfor %}{% endfor %}')
    assert (t.render(seq='ab') == 'TrueFalseTrueFalse')

dataset/ETHPy150Open GeekTrainer/Flask/Work/Trivia - Module 5/env/Lib/site-packages/jinja2/testsuite/core_tags.py ForLoopTestCase.test_scoped_loop_var/original