See #187: API logic for password reset

This commit is contained in:
Eliot Berriot 2018-05-06 11:30:41 +02:00
parent 929b50183a
commit 22f0b1a2d8
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
4 changed files with 41 additions and 7 deletions

View file

@ -136,6 +136,20 @@ def test_changing_password_updates_secret_key(logged_in_client):
assert user.password != password
def test_can_request_password_reset(
factories, api_client, mailoutbox):
user = factories['users.User']()
payload = {
'email': user.email,
}
emails = len(mailoutbox)
url = reverse('rest_password_reset')
response = api_client.post(url, payload)
assert response.status_code == 200
assert len(mailoutbox) > emails
def test_user_can_patch_his_own_settings(logged_in_api_client):
user = logged_in_api_client.user
payload = {