Add HTTP endpoint for resending email confirmation (#11354)

This commit is contained in:
Paulus Schoutsen authored and Pascal Vizeli committed 2017-12-29 14:46:10 +01:00
1 parent 2a2e6b6334
commit cfd78f7b02
4 files changed
+97

No files matched your search

+42
View File
@@ -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."""