Add HTTP endpoint for resending email confirmation (#11354)
This commit is contained in:
parent
2a2e6b6334
commit
cfd78f7b02
4 changed files with 97 additions and 0 deletions
|
@ -315,6 +315,48 @@ def test_forgot_password_view_unknown_error(mock_cognito, cloud_client):
|
|||
assert req.status == 502
|
||||
|
||||
|
||||
@asyncio.coroutine
|
||||
def test_resend_confirm_view(mock_cognito, cloud_client):
|
||||
"""Test logging out."""
|
||||
req = yield from cloud_client.post('/api/cloud/resend_confirm', json={
|
||||
'email': 'hello@bla.com',
|
||||
})
|
||||
assert req.status == 200
|
||||
assert len(mock_cognito.client.resend_confirmation_code.mock_calls) == 1
|
||||
|
||||
|
||||
@asyncio.coroutine
|
||||
def test_resend_confirm_view_bad_data(mock_cognito, cloud_client):
|
||||
"""Test logging out."""
|
||||
req = yield from cloud_client.post('/api/cloud/resend_confirm', json={
|
||||
'not_email': 'hello@bla.com',
|
||||
})
|
||||
assert req.status == 400
|
||||
assert len(mock_cognito.client.resend_confirmation_code.mock_calls) == 0
|
||||
|
||||
|
||||
@asyncio.coroutine
|
||||
def test_resend_confirm_view_request_timeout(mock_cognito, cloud_client):
|
||||
"""Test timeout while logging out."""
|
||||
mock_cognito.client.resend_confirmation_code.side_effect = \
|
||||
asyncio.TimeoutError
|
||||
req = yield from cloud_client.post('/api/cloud/resend_confirm', json={
|
||||
'email': 'hello@bla.com',
|
||||
})
|
||||
assert req.status == 502
|
||||
|
||||
|
||||
@asyncio.coroutine
|
||||
def test_resend_confirm_view_unknown_error(mock_cognito, cloud_client):
|
||||
"""Test unknown error while logging out."""
|
||||
mock_cognito.client.resend_confirmation_code.side_effect = \
|
||||
auth_api.UnknownError
|
||||
req = yield from cloud_client.post('/api/cloud/resend_confirm', json={
|
||||
'email': 'hello@bla.com',
|
||||
})
|
||||
assert req.status == 502
|
||||
|
||||
|
||||
@asyncio.coroutine
|
||||
def test_confirm_forgot_password_view(mock_cognito, cloud_client):
|
||||
"""Test logging out."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue