我有一个 flask 应用程序,我正在尝试为我构建的服务实施 pytest。所有路由都需要 Cognito 身份验证或 Cognito 组权限。有没有办法可以模拟或避免认知?从我在网上阅读的所有文章来看,到目前为止没有任何帮助。
如何为下面的示例实现 pytest?
@app.route('/hello')
@cognito_auth_required
@cognito_group_permissions(["test"])
def hello():
return 'Hello,World'