commit 77c7864933c1c623c69e4f74837813a9aff14341
Author: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Date: Mon Dec 21 20:01:58 2020 +0100
tests
diff --git a/tests/template_tests/relative_templates/dir1/dir2/inc3.html b/tests/template_tests/relative_templates/dir1/dir2/inc3.html
new file mode 100644
index 0000000000..7a8374df51
diff --git a/tests/template_tests/relative_templates/one2.html b/tests/template_tests/relative_templates/one2.html
new file mode 100644
index 0000000000..1d040e1fe8
|
-
|
+
|
|
| | 1 | {% extends tmpl %} |
| | 2 | |
| | 3 | {% block content %}{{ block.super }} one{% endblock %} |
diff --git a/tests/template_tests/test_extends_relative.py b/tests/template_tests/test_extends_relative.py
index 12324f0df6..53f769a31c 100644
|
a
|
b
|
class ExtendsRelativeBehaviorTests(SimpleTestCase):
|
| 16 | 16 | output = template.render(Context({})) |
| 17 | 17 | self.assertEqual(output.strip(), 'three two one') |
| 18 | 18 | |
| | 19 | def test_normal_var_extend(self): |
| | 20 | engine = Engine(dirs=[RELATIVE]) |
| | 21 | template = engine.get_template('one2.html') |
| | 22 | output = template.render(Context({'tmpl': './two.html'})) |
| | 23 | self.assertEqual(output.strip(), 'three two one') |
| | 24 | |
| 19 | 25 | def test_dir1_extend(self): |
| 20 | 26 | engine = Engine(dirs=[RELATIVE]) |
| 21 | 27 | template = engine.get_template('dir1/one.html') |
| … |
… |
class IncludeRelativeBehaviorTests(SimpleTestCase):
|
| 64 | 70 | output = template.render(Context({})) |
| 65 | 71 | self.assertEqual(output.strip(), 'dir2 include') |
| 66 | 72 | |
| | 73 | def test_normal_var_include(self): |
| | 74 | engine = Engine(dirs=[RELATIVE]) |
| | 75 | template = engine.get_template('dir1/dir2/inc3.html') |
| | 76 | output = template.render(Context({'tmpl': './include_content.html'})) |
| | 77 | self.assertEqual(output.strip(), 'dir2 include') |
| | 78 | |
| 67 | 79 | def test_dir2_include(self): |
| 68 | 80 | engine = Engine(dirs=[RELATIVE]) |
| 69 | 81 | template = engine.get_template('dir1/dir2/inc1.html') |