Merging upstream version 0.56+dfsg.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
683f3a672a
commit
aeb0367086
23 changed files with 131 additions and 20 deletions
|
@ -1,3 +1,7 @@
|
|||
"""
|
||||
JinjaX
|
||||
Copyright (c) Juan-Pablo Scaletti <juanpablo@jpscaletti.com>
|
||||
"""
|
||||
import time
|
||||
from textwrap import dedent
|
||||
|
||||
|
@ -243,6 +247,24 @@ def test_subfolder(catalog, folder, autoescape, undefined):
|
|||
assert html == Markup('<div class="tab">Meh</div>')
|
||||
|
||||
|
||||
@pytest.mark.parametrize("undefined", [jinja2.Undefined, jinja2.StrictUndefined])
|
||||
@pytest.mark.parametrize("autoescape", [True, False])
|
||||
def test_subfolder_index_file(catalog, folder, autoescape, undefined):
|
||||
"""Components named "index.jinja" in subfolders can be called
|
||||
using the subfolder names.
|
||||
"""
|
||||
catalog.jinja_env.autoescape = autoescape
|
||||
catalog.jinja_env.undefined = undefined
|
||||
|
||||
sub = folder / "tab"
|
||||
sub.mkdir()
|
||||
(sub / "index.jinja").write_text("Hello")
|
||||
(sub / "panel.jinja").write_text("World")
|
||||
|
||||
assert catalog.render("Tab") == Markup("Hello")
|
||||
assert catalog.render("Tab.Panel") == Markup("World")
|
||||
|
||||
|
||||
@pytest.mark.parametrize("undefined", [jinja2.Undefined, jinja2.StrictUndefined])
|
||||
@pytest.mark.parametrize("autoescape", [True, False])
|
||||
def test_default_attr(catalog, folder, autoescape, undefined):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue