mirror of
https://github.com/Hopiu/django.git
synced 2026-04-18 05:51:21 +00:00
Refs #32290 -- Added {% extends %} test for relative path in variable.
This commit is contained in:
parent
f4272d000a
commit
640a6e1dce
2 changed files with 9 additions and 0 deletions
3
tests/template_tests/relative_templates/one_var.html
Normal file
3
tests/template_tests/relative_templates/one_var.html
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{% extends tmpl %}
|
||||
|
||||
{% block content %}{{ block.super }} one{% endblock %}
|
||||
|
|
@ -16,6 +16,12 @@ class ExtendsRelativeBehaviorTests(SimpleTestCase):
|
|||
output = template.render(Context({}))
|
||||
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):
|
||||
engine = Engine(dirs=[RELATIVE])
|
||||
template = engine.get_template('dir1/one.html')
|
||||
|
|
|
|||
Loading…
Reference in a new issue