mirror of
https://github.com/GSA/notifications-api.git
synced 2026-04-12 05:09:35 -04:00
remove unneccessary ses endpoint tests
This commit is contained in:
@@ -95,7 +95,6 @@ def register_blueprint(application):
|
||||
from app.inbound_number.rest import inbound_number_blueprint
|
||||
from app.inbound_sms.rest import inbound_sms as inbound_sms_blueprint
|
||||
from app.notifications.receive_notifications import receive_notifications_blueprint
|
||||
from app.notifications.notifications_ses_callback import ses_callback_blueprint
|
||||
from app.notifications.notifications_sms_callback import sms_callback_blueprint
|
||||
from app.notifications.notifications_letter_callback import letter_callback_blueprint
|
||||
from app.authentication.auth import requires_admin_auth, requires_auth, requires_no_auth, restrict_ip_sms
|
||||
@@ -114,9 +113,6 @@ def register_blueprint(application):
|
||||
status_blueprint.before_request(requires_no_auth)
|
||||
application.register_blueprint(status_blueprint)
|
||||
|
||||
ses_callback_blueprint.before_request(requires_no_auth)
|
||||
application.register_blueprint(ses_callback_blueprint)
|
||||
|
||||
# delivery receipts
|
||||
# TODO: make sure research mode can still trigger sms callbacks, then re-enable this
|
||||
# sms_callback_blueprint.before_request(restrict_ip_sms)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
from datetime import datetime
|
||||
|
||||
from flask import (
|
||||
Blueprint,
|
||||
current_app,
|
||||
json
|
||||
)
|
||||
@@ -14,14 +13,6 @@ from app.dao import (
|
||||
from app.celery.statistics_tasks import create_outcome_notification_statistic_tasks
|
||||
from app.notifications.process_client_response import validate_callback_data
|
||||
|
||||
ses_callback_blueprint = Blueprint('notifications_ses_callback', __name__)
|
||||
|
||||
from app.errors import (
|
||||
register_errors,
|
||||
InvalidRequest
|
||||
)
|
||||
register_errors(ses_callback_blueprint)
|
||||
|
||||
|
||||
def process_ses_response(ses_request):
|
||||
client_name = 'SES'
|
||||
|
||||
@@ -10,24 +10,6 @@ from app.notifications.notifications_ses_callback import process_ses_response
|
||||
from tests.app.conftest import sample_notification as create_sample_notification
|
||||
|
||||
|
||||
def test_ses_callback_should_not_need_auth(client):
|
||||
response = client.post(
|
||||
path='/notifications/email/ses',
|
||||
data=ses_notification_callback(),
|
||||
headers=[('Content-Type', 'text/plain; charset=UTF-8')]
|
||||
)
|
||||
assert response.status_code == 200
|
||||
|
||||
|
||||
def test_ses_callback_should_fail_if_invalid_json(client, mocker):
|
||||
stats_mock = mocker.patch(
|
||||
'app.notifications.notifications_ses_callback.create_outcome_notification_statistic_tasks'
|
||||
)
|
||||
errors = process_ses_response('nonsense')
|
||||
assert errors == 'SES callback failed: invalid json'
|
||||
stats_mock.assert_not_called()
|
||||
|
||||
|
||||
def test_ses_callback_should_fail_if_invalid_notification_type(client, mocker):
|
||||
stats_mock = mocker.patch(
|
||||
'app.notifications.notifications_ses_callback.create_outcome_notification_statistic_tasks'
|
||||
|
||||
Reference in New Issue
Block a user