fix: raise TypeError when @app.template_filter is used without parentheses
This commit is contained in:
parent
a5f9742398
commit
2c331f67ea
2 changed files with 17 additions and 0 deletions
|
|
@ -130,6 +130,14 @@ def test_template_filter(app):
|
|||
assert app.jinja_env.filters["my_reverse"]("abcd") == "dcba"
|
||||
|
||||
|
||||
def test_template_filter_requires_parentheses(app):
|
||||
with pytest.raises(TypeError):
|
||||
|
||||
@app.template_filter
|
||||
def my_reverse(s):
|
||||
return s[::-1]
|
||||
|
||||
|
||||
def test_add_template_filter(app):
|
||||
def my_reverse(s):
|
||||
return s[::-1]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue