mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 07:35:34 -05:00
Added the mapping between notification and reply to email to the database and persisted the mapping when the request is received by the end point. the end point also checks if the reply to email id exists and if not returns an error. Also added tests to test the functionality.
This commit is contained in:
@@ -347,3 +347,26 @@ def test_check_service_email_reply_to_id_where_service_id_is_not_found(sample_se
|
||||
check_service_email_reply_to_id(fake_uuid, fake_uuid)
|
||||
assert e.value.status_code == 400
|
||||
assert e.value.message == 'email_reply_to_id does not exist in database'
|
||||
|
||||
|
||||
def test_check_service_email_reply_to_id_where_reply_to_id_is_none():
|
||||
assert check_service_email_reply_to_id(None, None) is None
|
||||
|
||||
|
||||
def test_check_service_email_reply_to_id_where_reply_to_id_is_not_found(sample_service, fake_uuid):
|
||||
with pytest.raises(BadRequestError) as e:
|
||||
check_service_email_reply_to_id(sample_service.id, fake_uuid)
|
||||
assert e.value.status_code == 400
|
||||
assert e.value.message == 'email_reply_to_id does not exist in database'
|
||||
|
||||
|
||||
def test_check_service_email_reply_to_id_where_reply_to_id_is_found(sample_service):
|
||||
reply_to_email = create_reply_to_email(sample_service, 'test@test.com')
|
||||
assert check_service_email_reply_to_id(sample_service.id, reply_to_email.id) is None
|
||||
|
||||
|
||||
def test_check_service_email_reply_to_id_where_service_id_is_not_found(sample_service, fake_uuid):
|
||||
with pytest.raises(BadRequestError) as e:
|
||||
check_service_email_reply_to_id(fake_uuid, fake_uuid)
|
||||
assert e.value.status_code == 400
|
||||
assert e.value.message == 'email_reply_to_id does not exist in database'
|
||||
|
||||
Reference in New Issue
Block a user