@@ -394,7 +394,7 @@ def test_invalid_block_suggestion(self):

try :

t = Template ( "{% if 1 %}lala{% endblock %}{% endif %}" )

except TemplateSyntaxError , e :

self . assertEqual ( e . args [ 0 ], "Invalid block tag: 'endblock', expected 'else' or 'endif'" )

self . assertEqual ( e . args [ 0 ], "Invalid block tag: 'endblock', expected ' elif', ' else' or 'endif'" )





def test_templates ( self ):

template_tests = self . get_template_tests ()

@@ -823,6 +823,17 @@ def get_template_tests(self):

'if-tag02' : ( "{% if foo %}yes{% else %}no{% endif %}" , { "foo" : False }, "no" ),

'if-tag03' : ( "{% if foo %}yes{% else %}no{% endif %}" , {}, "no" ),





'if-tag04' : ( "{% if foo %}foo{% elif bar %}bar{% endif %}" , { 'foo' : True }, "foo" ),

'if-tag05' : ( "{% if foo %}foo{% elif bar %}bar{% endif %}" , { 'bar' : True }, "bar" ),

'if-tag06' : ( "{% if foo %}foo{% elif bar %}bar{% endif %}" , {}, "" ),

'if-tag07' : ( "{% if foo %}foo{% elif bar %}bar{% else %}nothing{% endif %}" , { 'foo' : True }, "foo" ),

'if-tag08' : ( "{% if foo %}foo{% elif bar %}bar{% else %}nothing{% endif %}" , { 'bar' : True }, "bar" ),

'if-tag09' : ( "{% if foo %}foo{% elif bar %}bar{% else %}nothing{% endif %}" , {}, "nothing" ),

'if-tag10' : ( "{% if foo %}foo{% elif bar %}bar{% elif baz %}baz{% else %}nothing{% endif %}" , { 'foo' : True }, "foo" ),

'if-tag11' : ( "{% if foo %}foo{% elif bar %}bar{% elif baz %}baz{% else %}nothing{% endif %}" , { 'bar' : True }, "bar" ),

'if-tag12' : ( "{% if foo %}foo{% elif bar %}bar{% elif baz %}baz{% else %}nothing{% endif %}" , { 'baz' : True }, "baz" ),

'if-tag13' : ( "{% if foo %}foo{% elif bar %}bar{% elif baz %}baz{% else %}nothing{% endif %}" , {}, "nothing" ),





# Filters

'if-tag-filter01' : ( "{% if foo|length == 5 %}yes{% else %}no{% endif %}" , { 'foo' : 'abcde' }, "yes" ),