新手烧瓶问题.
我有一个看起来像这样的Flask路线:
@app.route('/')
def home():
return render_template(
'home.html',
greeting:"hello"
)
Run Code Online (Sandbox Code Playgroud)
如何测试'home.html'模板是否已呈现,以及render_template()上下文是否greeting使用特定值定义了变量?
这些应该(并且可能是)很容易测试,但我真的不确定如何使用Flask和unittest来做到这一点.