From 4317ba5799e2deae6059bebcb3d86e24d62e8e02 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Wed, 18 Jun 2008 12:59:39 +0000 Subject: Fixed #7318 -- Cleaned up the template inheritance logic, specifically to handle the case where the parent template has no template tags/blocks. Took the opportunity to optimize the logic a little. Thanks to Matthias Kestenholz for the original report and test case. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7688 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/templates/tests.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests') diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py index 4effea55de..089a6d312d 100644 --- a/tests/regressiontests/templates/tests.py +++ b/tests/regressiontests/templates/tests.py @@ -704,6 +704,12 @@ class Templates(unittest.TestCase): # Inheritance from local context with variable parent template 'inheritance25': ("{% extends context_template.1 %}{% block first %}2{% endblock %}{% block second %}4{% endblock %}", {'context_template': [template.Template("Wrong"), template.Template("1{% block first %}_{% endblock %}3{% block second %}_{% endblock %}")]}, '1234'), + # Set up a base template to extend + 'inheritance26': ("no tags", {}, 'no tags'), + + # Inheritance from a template that doesn't have any blocks + 'inheritance27': ("{% extends 'inheritance26' %}", {}, 'no tags'), + ### I18N ################################################################## # {% spaceless %} tag -- cgit v1.3