Skip to content

Commit

Permalink
Refs #24538 -- Simplified a test per Aymeric's feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
timgraham committed Apr 1, 2015
1 parent 0808ccc commit a184a99
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions tests/template_backends/test_jinja2.py
Expand Up @@ -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!')

0 comments on commit a184a99

Please sign in to comment.