the template_filter now expects the parentheses
This commit is contained in:
parent
a9bb965b6d
commit
5c9ef2c44d
2 changed files with 4 additions and 17 deletions
|
|
@ -311,16 +311,7 @@ class TemplatingTestCase(unittest.TestCase):
|
|||
macro = flask.get_template_attribute('_macro.html', 'hello')
|
||||
assert macro('World') == 'Hello World!'
|
||||
|
||||
def test_template_filter_not_called(self):
|
||||
app = flask.Flask(__name__)
|
||||
@app.template_filter
|
||||
def my_reverse(s):
|
||||
return s[::-1]
|
||||
assert 'my_reverse' in app.jinja_env.filters.keys()
|
||||
assert app.jinja_env.filters['my_reverse'] == my_reverse
|
||||
assert app.jinja_env.filters['my_reverse']('abcd') == 'dcba'
|
||||
|
||||
def test_template_filter_called(self):
|
||||
def test_template_filter(self):
|
||||
app = flask.Flask(__name__)
|
||||
@app.template_filter()
|
||||
def my_reverse(s):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue