mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 15:46:07 -05:00
Confirm no delivery estimate for emails and SMS
Only letters have a delivery estimate (which we calculate). This commit adds a test to make sure this remains the case.
This commit is contained in:
@@ -9,6 +9,11 @@ from tests.app.db import (
|
|||||||
create_template,
|
create_template,
|
||||||
create_service)
|
create_service)
|
||||||
|
|
||||||
|
from tests.app.conftest import (
|
||||||
|
sample_notification,
|
||||||
|
sample_email_notification,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize('billable_units, provider', [
|
@pytest.mark.parametrize('billable_units, provider', [
|
||||||
(1, 'mmg'),
|
(1, 'mmg'),
|
||||||
@@ -233,6 +238,26 @@ def test_get_notification_adds_delivery_estimate_for_letters(
|
|||||||
assert json_response['estimated_delivery'] == estimated_delivery
|
assert json_response['estimated_delivery'] == estimated_delivery
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize('notification_mock', [
|
||||||
|
sample_notification,
|
||||||
|
sample_email_notification,
|
||||||
|
])
|
||||||
|
def test_get_notification_doesnt_have_delivery_estimate_for_non_letters(
|
||||||
|
client,
|
||||||
|
notify_db,
|
||||||
|
notify_db_session,
|
||||||
|
notification_mock,
|
||||||
|
):
|
||||||
|
mocked_notification = notification_mock(notify_db, notify_db_session)
|
||||||
|
auth_header = create_authorization_header(service_id=mocked_notification.service_id)
|
||||||
|
response = client.get(
|
||||||
|
path='/v2/notifications/{}'.format(mocked_notification.id),
|
||||||
|
headers=[('Content-Type', 'application/json'), auth_header]
|
||||||
|
)
|
||||||
|
assert response.status_code == 200
|
||||||
|
assert 'estimated_delivery' not in json.loads(response.get_data(as_text=True))
|
||||||
|
|
||||||
|
|
||||||
def test_get_all_notifications_returns_200(client, sample_template):
|
def test_get_all_notifications_returns_200(client, sample_template):
|
||||||
notifications = [create_notification(template=sample_template) for _ in range(2)]
|
notifications = [create_notification(template=sample_template) for _ in range(2)]
|
||||||
notification = notifications[-1]
|
notification = notifications[-1]
|
||||||
|
|||||||
Reference in New Issue
Block a user