Only return non-archived email reply_to addresses

Updated the DAO methods which return a single email reply_to address and
all reply_to addresses to only return the non-archived addresses.

Changed the type of error that gets raised when using the Admin
interface to be BadRequestError instead of a SQLAlchemyError.
This commit is contained in:
Katie Smith
2018-04-25 12:19:12 +01:00
parent be28f2e2de
commit a57b2f50c2
6 changed files with 71 additions and 7 deletions

View File

@@ -319,8 +319,9 @@ def test_send_one_off_notification_should_throw_exception_if_reply_to_id_doesnot
'created_by': str(sample_email_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_email_template.service.id, post_data=data)
assert e.value.message == 'Reply to email address not found'
def test_send_one_off_notification_should_throw_exception_if_sms_sender_id_doesnot_exist(