diff --git a/django/template/loader_tags.py b/django/template/loader_tags.py
index 77508a7..20688ee 100644
a
|
b
|
class BlockNode(Node):
|
68 | 68 | return result |
69 | 69 | |
70 | 70 | def super(self): |
71 | | render_context = self.context.render_context |
| 71 | try: |
| 72 | render_context = self.context.render_context |
| 73 | except AttributeError: |
| 74 | raise TemplateSyntaxError("No parent block found for 'super'.") |
72 | 75 | if (BLOCK_CONTEXT_KEY in render_context and |
73 | 76 | render_context[BLOCK_CONTEXT_KEY].get_block(self.name) is not None): |
74 | 77 | return mark_safe(self.render(self.context)) |
diff --git a/tests/template_tests/tests.py b/tests/template_tests/tests.py
index e785962..84b6592 100644
a
|
b
|
class TemplateTests(TestCase):
|
881 | 881 | # Raise exception for custom tags used in child with {% load %} tag in parent, not in child |
882 | 882 | 'exception04': ("{% extends 'inheritance17' %}{% block first %}{% echo 400 %}5678{% endblock %}", {}, template.TemplateSyntaxError), |
883 | 883 | |
| 884 | # Raise exception for block.super used in base template |
| 885 | 'exception05': ("{% block first %}{{ block.super }}{% endblock %}", {}, template.TemplateSyntaxError), |
| 886 | |
884 | 887 | ### FILTER TAG ############################################################ |
885 | 888 | 'filter01': ('{% filter upper %}{% endfilter %}', {}, ''), |
886 | 889 | 'filter02': ('{% filter upper %}django{% endfilter %}', {}, 'DJANGO'), |