Module Expr Str Import alias ImportFrom alias ImportFrom alias alias alias alias alias alias Assign NameStore Call NameLoad ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Str Assert CompareEq Call AttributeLoad NameLoad attr keyword Num Str Assign NameStore Call AttributeLoad NameLoad attr Str Assert CompareEq Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assert CompareEq Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Str Assert CompareEq Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assert CompareEq Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assert CompareEq Call AttributeLoad NameLoad attr keyword Num Str decorator_list decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index Str Lambda arguments args NameParam NameParam defaults BinOpAdd NameLoad NameLoad Assert CompareEq Call AttributeLoad Call AttributeLoad NameLoad attr Str attr Str decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad keyword Call NameLoad Dict Str Str Assign NameStore Call AttributeLoad NameLoad attr Str Assert CompareEq Call AttributeLoad NameLoad attr keyword NameLoad Str Assert CompareEq Call AttributeLoad NameLoad attr keyword NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Str Assert CompareEq Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Str Assert CompareEq Call AttributeLoad Call AttributeLoad NameLoad attr attr BinOpMult Call NameLoad NameLoad Call NameLoad Num Num Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad keyword Str Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Str Assert CompareEq Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Str Assert CompareEq Call AttributeLoad NameLoad attr keyword Num Str Assert CompareEq Call AttributeLoad NameLoad attr keyword NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad keyword Str Assign NameStore Call AttributeLoad NameLoad attr Str Assert CompareEq Call AttributeLoad NameLoad attr keyword Num keyword NameLoad keyword Num keyword Num Str decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad Str Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr keyword ListLoad Num attr Assert CompareEq NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad Str Assert CompareEq ListComp Call AttributeLoad NameLoad attr comprehension NameStore Call AttributeLoad Call AttributeLoad NameLoad attr keyword ListLoad Dict Str Str Str Str Str Str attr ListLoad Str Str Str Str Str Str Str decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad Str Assign NameStore Call NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad keyword Call NameLoad Dict Str Call NameLoad Dict TryExcept body Expr Call AttributeLoad NameLoad attr Str handlers ExceptHandler type NameLoad name NameStore body Assert CompareEq AttributeLoad NameLoad attr Str orelse Assert NameLoad Str decorator_list decorator_list FunctionDef arguments args defaults body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list
N/A N/A 
    jinja2.testsuite.regression
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Tests corner cases and bugs.

    :copyright: (c) 2010 by the Jinja Team.
    :license: BSD, see LICENSE for more details.
 N/A unittest jinja2.testsuite JinjaTestCase jinja2 Template Environment DictLoader TemplateSyntaxError TemplateNotFound PrefixLoader N/A env N/A Environment CornerTestCase N/A JinjaTestCase N/A test_assigned_scoping N/A N/A self N/A N/A N/A t N/A N/A env from_string 
        {%- for item in (1, 2, 3, 4) -%}
            [{{ item }}]
        {%- endfor %}
        {{- item -}}
         N/A N/A N/A N/A t render item 42 [1][2][3][4]42 N/A t N/A N/A env from_string 
        {%- for item in (1, 2, 3, 4) -%}
            [{{ item }}]
        {%- endfor %}
        {%- set item = 42 %}
        {{- item -}}
         N/A N/A N/A N/A t render [1][2][3][4]42 N/A t N/A N/A env from_string 
        {%- set item = 42 %}
        {%- for item in (1, 2, 3, 4) -%}
            [{{ item }}]
        {%- endfor %}
        {{- item -}}
         N/A N/A N/A N/A t render [1][2][3][4]42 N/A test_closure_scoping N/A N/A self N/A N/A N/A t N/A N/A env from_string 
        {%- set wrapper = "<FOO>" %}
        {%- for item in (1, 2, 3, 4) %}
            {%- macro wrapper() %}[{{ item }}]{% endmacro %}
            {{- wrapper() }}
        {%- endfor %}
        {{- wrapper -}}
         N/A N/A N/A N/A t render [1][2][3][4]<FOO> N/A t N/A N/A env from_string 
        {%- for item in (1, 2, 3, 4) %}
            {%- macro wrapper() %}[{{ item }}]{% endmacro %}
            {{- wrapper() }}
        {%- endfor %}
        {%- set wrapper = "<FOO>" %}
        {{- wrapper -}}
         N/A N/A N/A N/A t render [1][2][3][4]<FOO> N/A t N/A N/A env from_string 
        {%- for item in (1, 2, 3, 4) %}
            {%- macro wrapper() %}[{{ item }}]{% endmacro %}
            {{- wrapper() }}
        {%- endfor %}
        {{- wrapper -}}
         N/A N/A N/A N/A t render wrapper 23 [1][2][3][4]23 N/A N/A BugTestCase N/A JinjaTestCase N/A test_keyword_folding N/A N/A self N/A N/A N/A env N/A Environment N/A N/A N/A env filters N/A testing N/A N/A N/A value some N/A N/A value some N/A N/A N/A N/A N/A N/A env from_string {{ 'test'|testing(some='stuff') }} render teststuff N/A test_extends_output_bugs N/A N/A self N/A N/A N/A env N/A Environment loader N/A DictLoader N/A parent.html (({% block title %}{% endblock %})) N/A t N/A N/A env from_string {% if expr %}{% extends "parent.html" %}{% endif %}[[{% block title %}title{% endblock %}]]{% for item in [1, 2, 3] %}({{ item }}){% endfor %} N/A N/A N/A N/A t render expr False [[title]](1)(2)(3) N/A N/A N/A N/A t render expr True ((title)) N/A test_urlize_filter_escaping N/A N/A self N/A N/A N/A tmpl N/A N/A env from_string {{ "http://www.example.org/<foo"|urlize }} N/A N/A N/A N/A tmpl render <a href="http://www.example.org/&lt;foo">http://www.example.org/&lt;foo</a> N/A test_loop_call_loop N/A N/A self N/A N/A N/A tmpl N/A N/A env from_string 

        {% macro test() %}
            {{ caller() }}
        {% endmacro %}

        {% for num1 in range(5) %}
            {% call test() %}
                {% for num2 in range(10) %}
                    {{ loop.index }}
                {% endfor %}
            {% endcall %}
        {% endfor %}

         N/A N/A N/A N/A N/A N/A tmpl render split N/A N/A map unicode N/A range 1 11 5 N/A test_weird_inline_comment N/A N/A self N/A N/A N/A env N/A Environment line_statement_prefix % N/A N/A N/A self assert_raises TemplateSyntaxError N/A env from_string % for item in seq {# missing #}
...% endfor N/A test_old_macro_loop_scoping_bug N/A N/A self N/A N/A N/A tmpl N/A N/A env from_string {% for i in (1, 2) %}{{ i }}{% endfor %}{% macro i() %}3{% endmacro %}{{ i() }} N/A N/A N/A N/A tmpl render 123 N/A test_partial_conditional_assignments N/A N/A self N/A N/A N/A tmpl N/A N/A env from_string {% if b %}{% set a = 42 %}{% endif %}{{ a }} N/A N/A N/A N/A tmpl render a 23 23 N/A N/A N/A N/A tmpl render b True 42 N/A test_stacked_locals_scoping_bug N/A N/A self N/A N/A N/A env N/A Environment line_statement_prefix # N/A t N/A N/A env from_string # for j in [1, 2]:
#   set x = 1
#   for i in [1, 2]:
#     print x
#     if i % 2 == 0:
#       set x = x + 1
#     endif
#   endfor
# endfor
# if a
#   print 'A'
# elif b
#   print 'B'
# elif c == d
#   print 'C'
# else
#   print 'D'
# endif
     N/A N/A N/A N/A t render a 0 b False c 42 d 42.0 1111C N/A test_stacked_locals_scoping_bug_twoframe N/A N/A self N/A N/A N/A t N/A Template 
            {% set x = 1 %}
            {% for item in foo %}
                {% if item == 1 %}
                    {% set x = 2 %}
                {% endif %}
            {% endfor %}
            {{ x }}
         N/A rv N/A N/A N/A N/A t render foo N/A 1 strip N/A N/A rv 1 N/A test_call_with_args N/A N/A self N/A N/A N/A t N/A Template {% macro dump_users(users) -%}
        <ul>
          {%- for user in users -%}
            <li><p>{{ user.username|e }}</p>{{ caller(user) }}</li>
          {%- endfor -%}
          </ul>
        {%- endmacro -%}

        {% call(user) dump_users(list_of_user) -%}
          <dl>
            <dl>Realname</dl>
            <dd>{{ user.realname|e }}</dd>
            <dl>Description</dl>
            <dd>{{ user.description }}</dd>
          </dl>
        {% endcall %} N/A N/A N/A N/A N/A x strip N/A x N/A N/A N/A N/A t render list_of_user N/A N/A username realname description apo something else test splitlines N/A <ul><li><p>apo</p><dl> <dl>Realname</dl> <dd>something else</dd> <dl>Description</dl> <dd>test</dd> </dl> </li></ul> N/A test_empty_if_condition_fails N/A N/A self N/A N/A N/A N/A N/A self assert_raises TemplateSyntaxError Template {% if %}....{% endif %} N/A N/A N/A self assert_raises TemplateSyntaxError Template {% if foo %}...{% elif %}...{% endif %} N/A N/A N/A self assert_raises TemplateSyntaxError Template {% for x in %}..{% endfor %} N/A test_recursive_loop_bug N/A N/A self N/A N/A N/A tpl1 N/A Template 
        {% for p in foo recursive%}
            {{p.bar}}
            {% for f in p.fields recursive%}
                {{f.baz}}
                {{p.bar}}
                {% if f.rec %}
                    {{ loop(f.sub) }}
                {% endif %}
            {% endfor %}
        {% endfor %}
         N/A tpl2 N/A Template 
        {% for p in foo%}
            {{p.bar}}
            {% for f in p.fields recursive%}
                {{f.baz}}
                {{p.bar}}
                {% if f.rec %}
                    {{ loop(f.sub) }}
                {% endif %}
            {% endfor %}
        {% endfor %}
         N/A test_correct_prefix_loader_name N/A N/A self N/A N/A N/A env N/A Environment loader N/A PrefixLoader N/A foo N/A DictLoader N/A N/A N/A N/A N/A N/A env get_template foo/bar.html N/A N/A N/A TemplateNotFound N/A e N/A N/A N/A N/A e name foo/bar.html N/A N/A False expected error here N/A N/A suite N/A N/A N/A N/A N/A suite N/A N/A unittest TestSuite N/A N/A N/A suite addTest N/A N/A unittest makeSuite CornerTestCase N/A N/A N/A suite addTest N/A N/A unittest makeSuite BugTestCase N/A suite N/A