Сам тест
@pytest.fixture
def client():
app.config['TESTING'] = True
with app.test_client() as cl:
with app.app_context():
yield cl
def test_auth(client):
payload = {
'username': 'testing',
'password': 'hard_pass'
}
resp = client.post('/login', data=jsonify(payload))
assert resp.status_code == 200
views.py, на данный момент, выглядит следующим образом
@app.route('/login', methods=['POST'])
def login():
return 'This is your login'
Ошибка следующая:
d = <Response 46 bytes [200 OK]>, args = (), kwargs = {}
> iteritems = lambda d, *args, **kwargs: iter(d.items(*args, **kwargs))
E AttributeError: 'Response' object has no attribute 'items'
blog_env\lib\site-packages\werkzeug\_compat.py:135: AttributeError