Return empty list when there are no users for the service.

Added a test for when there are no users for the service.
Added a test_url_for - do we want to add this test and use url_for in our tests?
Or explictly write the url in the test?
This commit is contained in:
Rebecca Law
2016-02-24 10:30:00 +00:00
parent 12a2d8db0a
commit f1fdfbb308
3 changed files with 64 additions and 2 deletions

View File

@@ -161,7 +161,7 @@ def get_api_keys(service_id, key_id=None):
def get_users_for_service(service_id):
fetched = dao_fetch_service_by_id(service_id)
if not fetched:
return jsonify(result="error", message="Service not found"), 404
print(fetched.users)
return jsonify(data=[])
result = users_schema.dump(fetched.users)
return jsonify(data=result.data)