mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-22 08:21:13 -05:00
Updated send user code to use an optional to field to send emails
Added tests for send_user_code
This commit is contained in:
@@ -151,3 +151,30 @@ def sample_admin_service_id(notify_db, notify_db_session):
|
||||
api_key = ApiKey(**data)
|
||||
save_model_api_key(api_key)
|
||||
return admin_service.id
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def mock_notify_client_send_sms(mocker):
|
||||
def _send(mobile_number, message):
|
||||
pass
|
||||
|
||||
mock_class = mocker.patch('app.notify_alpha_client.send_sms', side_effect=_send)
|
||||
return mock_class
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def mock_notify_client_send_email(mocker):
|
||||
def _send(email_address, message, from_address, subject):
|
||||
pass
|
||||
|
||||
mock_class = mocker.patch('app.notify_alpha_client.send_email', side_effect=_send)
|
||||
return mock_class
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def mock_secret_code(mocker):
|
||||
def _create():
|
||||
return '11111'
|
||||
|
||||
mock_class = mocker.patch('app.dao.users_dao.create_secret_code', side_effect=_create)
|
||||
return mock_class
|
||||
|
||||
Reference in New Issue
Block a user