Ticket #21707: 21707.patch

File 21707.patch, 1.5 KB (added by ANUBHAV JOSHI, 10 years ago)
  • django/template/base.py

    diff --git a/django/template/base.py b/django/template/base.py
    index 5615478..fdae105 100644
    a b class Variable(object):  
    798798                                current = settings.TEMPLATE_STRING_IF_INVALID  # invalid method call
    799799                            else:
    800800                                raise
     801                        except AttributeError:
     802                            raise TemplateSyntaxError
    801803        except Exception as e:
    802804            if getattr(e, 'silent_variable_failure', False):
    803805                current = settings.TEMPLATE_STRING_IF_INVALID
  • tests/template_tests/tests.py

    diff --git a/tests/template_tests/tests.py b/tests/template_tests/tests.py
    index 4ec6815..92983d9 100644
    a b class TemplateTests(TestCase):  
    881881            # Raise exception for custom tags used in child with {% load %} tag in parent, not in child
    882882            'exception04': ("{% extends 'inheritance17' %}{% block first %}{% echo 400 %}5678{% endblock %}", {}, template.TemplateSyntaxError),
    883883
     884            # Raise exception for block.super used in base template
     885            'exception05': ("{% block first %}{{ block.super }}{% endblock %}", {}, template.TemplateSyntaxError),
     886
    884887            ### FILTER TAG ############################################################
    885888            'filter01': ('{% filter upper %}{% endfilter %}', {}, ''),
    886889            'filter02': ('{% filter upper %}django{% endfilter %}', {}, 'DJANGO'),
Back to Top