ValueError: dictionary update sequence element #0 has length 8; 2 is required on executing jsonify(r)[dict((cursor.description[i][0], value) for i, value in enumerate(row)) for row in result]
return jsonify
这些函数在本质上似乎是基于Flask的,我发现返回JSON的最佳方法是使用Flask的jsonify函数。在部署时,这看起来很好,但是我想设置一些本地单元测试,这里是我陷入困境的地方。只需添加要导入jsonify的行,就会导致以下错误:
RuntimeError: Working outside of application context.我发现的所有示例对于这个特定的用例都没有用处。有人能建议一种构建单元测试<e
在我的用例中,我有两个可能的错误:'RSA key format is not supported'用于不正确的密码,'PEM encryption format not supported.'用于所需的密码,但没有给出。这两种类型都是ValueError类型。我试着试着-除了from Crypto.PublicKey import