I have a Flask route that looks like this:
@app.route('/')
def home():
return render_template(
'home.html',
greeting:"hello"
)
How do I test that the 'home.html' template was rendered, and that the render_template() context defined the greeting variable with a particular value?
These should be (and probably are) pretty easy to test, but I'm really not sure how to do this with Flask and unittest.
greeting:"hello"you wanted to writegreeting="hello"? - Martin Thoma