mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-06-17 03:40:41 -04:00
Merge pull request #4186 from alphagov/tell-admin-app-base-url-for-registration-email
Pass admin URL to API for registration email
This commit is contained in:
@@ -101,7 +101,10 @@ class UserApiClient(NotifyAdminAPIClient):
|
||||
self.post(endpoint, data=data)
|
||||
|
||||
def send_verify_email(self, user_id, to):
|
||||
data = {'to': to}
|
||||
data = {
|
||||
'to': to,
|
||||
'admin_base_url': self.admin_url,
|
||||
}
|
||||
endpoint = '/user/{0}/email-verification'.format(user_id)
|
||||
self.post(endpoint, data=data)
|
||||
|
||||
|
||||
@@ -325,3 +325,22 @@ def test_reset_password(
|
||||
'admin_base_url': 'http://localhost:6012',
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
def test_send_registration_email(
|
||||
mocker,
|
||||
fake_uuid,
|
||||
):
|
||||
mock_post = mocker.patch(
|
||||
'app.notify_client.user_api_client.UserApiClient.post'
|
||||
)
|
||||
|
||||
user_api_client.send_verify_email(fake_uuid, 'test@example.com')
|
||||
|
||||
mock_post.assert_called_once_with(
|
||||
f'/user/{fake_uuid}/email-verification',
|
||||
data={
|
||||
'to': 'test@example.com',
|
||||
'admin_base_url': 'http://localhost:6012',
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user