1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Fixed #32290 -- Fixed TemplateNotFound in {% include %} tag for relative path in variable.

This commit is contained in:
Hasan Ramezani
2020-12-27 21:21:59 +01:00
committed by Mariusz Felisiak
parent 640a6e1dce
commit c978dd93fd
3 changed files with 19 additions and 4 deletions

View File

@@ -70,6 +70,12 @@ class IncludeRelativeBehaviorTests(SimpleTestCase):
output = template.render(Context({}))
self.assertEqual(output.strip(), 'dir2 include')
def test_normal_include_variable(self):
engine = Engine(dirs=[RELATIVE])
template = engine.get_template('dir1/dir2/inc3.html')
output = template.render(Context({'tmpl': './include_content.html'}))
self.assertEqual(output.strip(), 'dir2 include')
def test_dir2_include(self):
engine = Engine(dirs=[RELATIVE])
template = engine.get_template('dir1/dir2/inc1.html')