mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 09:51:11 -05:00
Only return active SMS senders
Updated the DAO methods which return a single SMS sender and all SMS senders to only return the non-archived senders. Changed the error raised in the Admin interface from a SQLAlchemyError to a BadRequestError.
This commit is contained in:
@@ -3,7 +3,6 @@ from unittest.mock import Mock
|
||||
|
||||
import pytest
|
||||
from notifications_utils.recipients import InvalidPhoneError
|
||||
from sqlalchemy.exc import SQLAlchemyError
|
||||
|
||||
from app.v2.errors import BadRequestError, TooManyRequestsError
|
||||
from app.config import QueueNames
|
||||
@@ -334,5 +333,6 @@ def test_send_one_off_notification_should_throw_exception_if_sms_sender_id_doesn
|
||||
'created_by': str(sample_template.service.created_by_id)
|
||||
}
|
||||
|
||||
with pytest.raises(expected_exception=SQLAlchemyError):
|
||||
with pytest.raises(expected_exception=BadRequestError) as e:
|
||||
send_one_off_notification(service_id=sample_template.service.id, post_data=data)
|
||||
assert e.value.message == 'SMS sender not found'
|
||||
|
||||
Reference in New Issue
Block a user