summaryrefslogtreecommitdiff
path: root/tests/template_backends
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:08:43 -0400
commita184a99123e4dc4c2a90c20e1604e5d301cd76bf (patch)
treef78cca13335763fb891302f3fb6fe1fc6711dd18 /tests/template_backends
parent0808ccce3808235c5b5a56e3f689cec0d4bc0ebf (diff)
Refs #24538 -- Simplified a test per Aymeric's feedback.
Diffstat (limited to 'tests/template_backends')
-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 4c22c0958b..d2a52d900c 100644
--- a/tests/template_backends/test_jinja2.py
+++ b/tests/template_backends/test_jinja2.py
@@ -24,18 +24,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!')