fix: raise TypeError when @app.template_filter is used without parentheses

This commit is contained in:
gable-github 2025-05-16 15:07:40 -07:00
parent a5f9742398
commit 2c331f67ea
2 changed files with 17 additions and 0 deletions

View file

@ -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]