summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-04-01 13:08:43 -0400
committerTim Graham <timograham@gmail.com>2015-04-01 13:19:57 -0400
commit5a4f95805f9b4f709cfcac53a453b59bd40a9946 (patch)
treeb735a7fb7d3e6901f0c207cfe5b048f0927e0270
parent5c63c45512eeca1f9c2dbdb0c46cbc7d9c550bdc (diff)
[1.8.x] Refs #24538 -- Simplified a test per Aymeric's feedback.
Backport of a184a99123e4dc4c2a90c20e1604e5d301cd76bf from master
-rw-r--r--tests/template_backends/test_jinja2.py11
1 files changed, 2 insertions, 9 deletions
diff --git a/tests/template_backends/test_jinja2.py b/tests/template_backends/test_jinja2.py
index 17cdb05df0..ae2f42a82d 100644
--- a/tests/template_backends/test_jinja2.py
+++ b/tests/template_backends/test_jinja2.py
@@ -30,18 +30,11 @@ class Jinja2Tests(TemplateStringsTests):
def test_self_context(self):
"""
- #24538 -- Using 'self' in the context should not throw errors
+ Using 'self' in the context should not throw errors (#24538).
"""
- engine = Jinja2({
- 'DIRS': [],
- 'APP_DIRS': False,
- 'NAME': 'django',
- 'OPTIONS': {},
- })
-
# self will be overridden to be a TemplateReference, so the self
# variable will not come through. Attempting to use one though should
# not throw an error.
- template = engine.from_string('hello {{ foo }}!')
+ template = self.engine.from_string('hello {{ foo }}!')
content = template.render(context={'self': 'self', 'foo': 'world'})
self.assertEqual(content, 'hello world!')