Feat: add test on add_filter
This commit is contained in:
parent
25b5bde823
commit
87ebb4c284
@ -29,3 +29,12 @@ def test_block_line_statement_with_comment():
|
||||
jinja2_template = texenv.from_string(base_template)
|
||||
output = jinja2_template.render()
|
||||
assert output == "\n2"
|
||||
|
||||
def test_add_filter():
|
||||
texenv.filters["count_caracters"] = lambda x: len(x)
|
||||
base_template = r"""\Var{a} has \Var{a | count_caracters}"""
|
||||
jinja2_template = texenv.from_string(base_template)
|
||||
output = jinja2_template.render(a="coucou")
|
||||
assert output == "coucou has 6"
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user