mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 01:41:05 -05:00
Merge pull request #2935 from alphagov/remove-jobs-incomplete-error
Stop raising error in scheduled task
This commit is contained in:
@@ -8,7 +8,7 @@ def app_for_test():
|
||||
import flask
|
||||
from flask import Blueprint
|
||||
from app.authentication.auth import AuthError
|
||||
from app.v2.errors import BadRequestError, TooManyRequestsError, JobIncompleteError
|
||||
from app.v2.errors import BadRequestError, TooManyRequestsError
|
||||
from app import init_app
|
||||
|
||||
app = flask.Flask(__name__)
|
||||
@@ -42,10 +42,6 @@ def app_for_test():
|
||||
def raising_data_error():
|
||||
raise DataError("There was a db problem", "params", "orig")
|
||||
|
||||
@blue.route("raise_job_incomplete_error", methods=["GET"])
|
||||
def raising_job_incomplete_error():
|
||||
raise JobIncompleteError("Raising job incomplete error")
|
||||
|
||||
@blue.route("raise_exception", methods=["GET"])
|
||||
def raising_exception():
|
||||
raise AssertionError("Raising any old exception")
|
||||
@@ -114,16 +110,6 @@ def test_data_errors(app_for_test):
|
||||
"errors": [{"error": "DataError", "message": "No result found"}]}
|
||||
|
||||
|
||||
def test_job_incomplete_errors(app_for_test):
|
||||
with app_for_test.test_request_context():
|
||||
with app_for_test.test_client() as client:
|
||||
response = client.get(url_for('v2_under_test.raising_job_incomplete_error'))
|
||||
assert response.status_code == 500
|
||||
error = response.json
|
||||
assert error == {"status_code": 500,
|
||||
"errors": [{"error": "JobIncompleteError", "message": "Raising job incomplete error"}]}
|
||||
|
||||
|
||||
def test_internal_server_error_handler(app_for_test):
|
||||
with app_for_test.test_request_context():
|
||||
with app_for_test.test_client() as client:
|
||||
|
||||
Reference in New Issue
Block a user