Wire up error handlers.

Replace some 400s with more appropriate 500s.

DAO methods that cause unexpected exceptions get caught and
logged by errors.py 500 error handler.
This commit is contained in:
Adam Shimali
2016-02-17 17:04:50 +00:00
parent b98d8b9996
commit 4f33b6f406
7 changed files with 66 additions and 55 deletions

View File

@@ -146,7 +146,7 @@ def test_post_service_without_users_attribute(notify_api, notify_db, notify_db_s
url_for('service.create_service'),
data=json.dumps(data),
headers=headers)
assert resp.status_code == 400
assert resp.status_code == 500
assert Service.query.count() == 0
json_resp = json.loads(resp.get_data(as_text=True))
assert json_resp['message'] == '{"users": ["Missing data for required attribute"]}'