Refs #32290 -- Added {% extends %} test for relative path in variable.

This commit is contained in:
Hasan Ramezani 2020-12-27 21:15:17 +01:00 committed by Mariusz Felisiak
parent f4272d000a
commit 640a6e1dce
2 changed files with 9 additions and 0 deletions

View File

@ -0,0 +1,3 @@
{% extends tmpl %}
{% block content %}{{ block.super }} one{% endblock %}

View File

@ -16,6 +16,12 @@ class ExtendsRelativeBehaviorTests(SimpleTestCase):
output = template.render(Context({})) output = template.render(Context({}))
self.assertEqual(output.strip(), 'three two one') self.assertEqual(output.strip(), 'three two one')
def test_normal_extend_variable(self):
engine = Engine(dirs=[RELATIVE])
template = engine.get_template('one_var.html')
output = template.render(Context({'tmpl': './two.html'}))
self.assertEqual(output.strip(), 'three two one')
def test_dir1_extend(self): def test_dir1_extend(self):
engine = Engine(dirs=[RELATIVE]) engine = Engine(dirs=[RELATIVE])
template = engine.get_template('dir1/one.html') template = engine.get_template('dir1/one.html')