mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 09:26:08 -05:00
remove v2
This commit is contained in:
@@ -3,13 +3,9 @@ import pytest
|
||||
from app.dao.api_key_dao import save_model_api_key
|
||||
from app.enums import KeyType
|
||||
from app.models import ApiKey
|
||||
from app.v2.notifications.notification_schemas import (
|
||||
get_notification_response,
|
||||
get_notifications_response,
|
||||
)
|
||||
from tests import create_service_authorization_header
|
||||
|
||||
from . import return_json_from_response, validate, validate_v0
|
||||
from . import return_json_from_response, validate_v0
|
||||
|
||||
|
||||
def _get_notification(client, notification, url):
|
||||
@@ -27,46 +23,6 @@ def _get_notification(client, notification, url):
|
||||
return client.get(url, headers=[auth_header])
|
||||
|
||||
|
||||
# v2
|
||||
|
||||
|
||||
def test_get_v2_sms_contract(client, sample_notification, mocker):
|
||||
mock_s3_personalisation = mocker.patch(
|
||||
"app.v2.notifications.get_notifications.get_personalisation_from_s3"
|
||||
)
|
||||
mock_s3_personalisation.return_value = {}
|
||||
response_json = return_json_from_response(
|
||||
_get_notification(
|
||||
client,
|
||||
sample_notification,
|
||||
"/v2/notifications/{}".format(sample_notification.id),
|
||||
)
|
||||
)
|
||||
validate(response_json, get_notification_response)
|
||||
|
||||
|
||||
def test_get_v2_email_contract(client, sample_email_notification, mocker):
|
||||
mock_s3_personalisation = mocker.patch(
|
||||
"app.v2.notifications.get_notifications.get_personalisation_from_s3"
|
||||
)
|
||||
mock_s3_personalisation.return_value = {}
|
||||
response_json = return_json_from_response(
|
||||
_get_notification(
|
||||
client,
|
||||
sample_email_notification,
|
||||
"/v2/notifications/{}".format(sample_email_notification.id),
|
||||
)
|
||||
)
|
||||
validate(response_json, get_notification_response)
|
||||
|
||||
|
||||
def test_get_v2_notifications_contract(client, sample_notification):
|
||||
response_json = return_json_from_response(
|
||||
_get_notification(client, sample_notification, "/v2/notifications")
|
||||
)
|
||||
validate(response_json, get_notifications_response)
|
||||
|
||||
|
||||
# v0
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user