mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 07:35:34 -05:00
retry
This commit is contained in:
@@ -19,7 +19,7 @@ from app.models import (
|
||||
ServiceGuestList,
|
||||
)
|
||||
from app.service.send_notification import send_one_off_notification
|
||||
from app.v2.errors import BadRequestError, TooManyRequestsError
|
||||
from app.v2.errors import BadRequestError
|
||||
from tests.app.db import (
|
||||
create_reply_to_email,
|
||||
create_service,
|
||||
@@ -235,24 +235,6 @@ def test_send_one_off_notification_raises_if_cant_send_to_recipient(
|
||||
assert 'service is in trial mode' in e.value.message
|
||||
|
||||
|
||||
def test_send_one_off_notification_raises_if_over_limit(notify_db_session, mocker):
|
||||
service = create_service(message_limit=0)
|
||||
template = create_template(service=service)
|
||||
mocker.patch(
|
||||
'app.service.send_notification.check_service_over_daily_message_limit',
|
||||
side_effect=TooManyRequestsError(1)
|
||||
)
|
||||
|
||||
post_data = {
|
||||
'template_id': str(template.id),
|
||||
'to': '07700 900 001',
|
||||
'created_by': str(service.created_by_id)
|
||||
}
|
||||
|
||||
with pytest.raises(TooManyRequestsError):
|
||||
send_one_off_notification(service.id, post_data)
|
||||
|
||||
|
||||
def test_send_one_off_notification_raises_if_message_too_long(persist_mock, notify_db_session):
|
||||
service = create_service()
|
||||
template = create_template(service=service, content="Hello (( Name))\nYour thing is due soon")
|
||||
|
||||
Reference in New Issue
Block a user