Skip to content
Myr

Fixed the choice include tests.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

--HG-- branch : trunk

authored by Armin Ronacher · committed by Armin Ronacher · parent 31bbd9e · Browse files · 2 files+12 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+12 added−1 removed

  • tests:+11 added−0 removed
  • other:+1 added−1 removed

2 files+12 added−1 removed

modified:jinja2/exceptions.py+1 added-1 removed
57 unmodified lines
5859 def __init__(self, names=(), message=None):60 if message is None:61 message = u'non of the templates given were found: ' + \62 u', '.join(names)62 u', '.join(map(unicode, names))63 TemplateNotFound.__init__(self, names and names[-1] or None, message)64 self.templates = list(names)6566
69 unmodified lines
modified:tests/test_imports.py+11 added
59 unmodified lines
60 assert e.name == 'missing2'61 else:62 assert False, 'thou shalt raise'6364 def test_includes(t, **ctx):65 ctx['foo'] = 4266 assert t.render(ctx) == '[42|23]'6768 t = test_env.from_string('{% include ["missing", "header"] %}')69 test_includes(t)70 t = test_env.from_string('{% include x %}')71 test_includes(t, x=['missing', 'header'])72 t = test_env.from_string('{% include [x, "header"] %}')73 test_includes(t, x='missing')747576def test_include_ignoring_missing():77 t = test_env.from_string('{% include "missing" %}')78 assert_raises(TemplateNotFound, t.render)79 for extra in '', 'with context', 'without context':
47 unmodified lines