

def test_loop_filter(self):
    tmpl = env.from_string('{% for item in range(10) if item is even %}[{{ item }}]{% endfor %}')
    assert (tmpl.render() == '[0][2][4][6][8]')
    tmpl = env.from_string('\n            {%- for item in range(10) if item is even %}[{{\n                loop.index }}:{{ item }}]{% endfor %}')
    assert (self.render() == '[1:0][2:2][3:4][4:6][5:8]')

dataset/ETHPy150Open GeekTrainer/Flask/Work/Trivia - Module 5/env/Lib/site-packages/jinja2/testsuite/core_tags.py ForLoopTestCase.test_loop_filter/VarMisuse@41/136 `tmpl`->`self`