Skip to content
Myr

Merge branch 'master' of github.com:mitsuhiko/jinja2

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

authored by Armin Ronacher · committed by Armin Ronacher · parents a65f1eb, 83f6a68 · Browse files · 3 files+9 added−2 removed
This commit

State

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

Diff stats

3 files+9 added−2 removed

  • other:+9 added−2 removed

3 files+9 added−2 removed

modified:docs/templates.rst+1 added-1 removed
828 unmodified lines
829default. For more details about context behavior of imports and includes830see :ref:`import-visibility`.831832From Jinja 2.2 onwards you can mark an include with ``ignore missing`` in833which case Jinja will ignore the statement if the template to be ignored833which case Jinja will ignore the statement if the template to be included834does not exist. When combined with ``with`` or ``without context`` it has835to be placed *before* the context visibility statement. Here some valid836examples::837
588 unmodified lines
modified:jinja2/testsuite/loader.py+7 added
91 unmodified lines
92 assert 'one' in env.cache93 assert 'two' not in env.cache94 assert 'three' in env.cache9596 def test_dict_loader_cache_invalidates(self):97 mapping = {'foo': "one"}98 env = Environment(loader=loaders.DictLoader(mapping))99 assert env.get_template('foo').render() == "one"100 mapping['foo'] = "two"101 assert env.get_template('foo').render() == "two"102103 def test_split_template_path(self):104 assert split_template_path('foo/bar') == ['foo', 'bar']105 assert split_template_path('./foo/bar') == ['foo', 'bar']106 self.assert_raises(TemplateNotFound, split_template_path, '../foo')
119 unmodified lines
modified:jinja2/loaders.py+1 added-1 removed
273 unmodified lines
274275 def get_source(self, environment, template):276 if template in self.mapping:277 source = self.mapping[template]278 return source, None, lambda: source != self.mapping.get(template)278 return source, None, lambda: source == self.mapping.get(template)279 raise TemplateNotFound(template)280281 def list_templates(self):282 return sorted(self.mapping)
192 unmodified lines