celery test cleanup

* Alter config so an error will be raised if you forget to mock out a
  celery call in one of your tests
* Remove an unneeded exception type that was masking errors
This commit is contained in:
Leo Hemsted
2017-06-19 14:58:38 +01:00
parent 88a479a4bb
commit ac7665bfc6
8 changed files with 16 additions and 33 deletions

View File

@@ -5,7 +5,6 @@ from sqlalchemy.exc import DataError
from sqlalchemy.orm.exc import NoResultFound
from app.authentication.auth import AuthError
from app.errors import InvalidRequest
from app.notifications import SendNotificationToQueueError
class TooManyRequestsError(InvalidRequest):
@@ -61,13 +60,6 @@ def register_errors(blueprint):
def auth_error(error):
return jsonify(error.to_dict_v2()), error.code
@blueprint.errorhandler(SendNotificationToQueueError)
def failed_to_create_notification(error):
current_app.logger.exception(error)
return jsonify(
status_code=500,
errors=[{"error": error.__class__.__name__, "message": error.message}]), 500
@blueprint.errorhandler(Exception)
def internal_server_error(error):
current_app.logger.exception(error)