def test_patch(client): """Can we PATCH an existing resource?""" response = client.patch( '/artist/1', data=json.dumps({'Name': 'Jeff Knupp'}), headers={'Content-type': 'application/json'}, ) assert response.status_code == 200
def test_validate_patch(client): """Do we get back an error message when making a PATCH request on an existing resource?""" response = client.patch('/user/1', data=json.dumps({ 'name': 'Jeff Knupp', }), headers={'Content-Type': 'application/json'}) assert response.status_code == 400 assert response.json['message'] == INVALID_ACTION_MESSAGE
def test_validate_patch(client): """Do we get back an error message when making a PATCH request on an existing resource?""" response = client.patch( '/user/1', data=json.dumps({ 'name': 'Jeff Knupp', }), headers={'Content-Type': 'application/json'} ) assert response.status_code == 400 assert response.json['message'] == INVALID_ACTION_MESSAGE
def test_patch_no_data(client): """Do we get an error if we try to PATCH a non-existent resource?""" response = client.patch('/artist/1', ) assert response.status_code == 400