Skip to content

Commit

Permalink
test: reset password on a user who has no password
Browse files Browse the repository at this point in the history
The user may have been invited via a social network or an invitation
system.
  • Loading branch information
nickretallack committed May 12, 2015
1 parent 5697ff8 commit c10c905
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/test_recoverable.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,21 @@ def test_used_reset_token(client, get_message):
assert msg in response2.data


def test_reset_passwordless_user(client, get_message):
with capture_reset_password_requests() as requests:
client.post('/reset', data=dict(email='[email protected]'), follow_redirects=True)

token = requests[0]['token']

# use the token
response = client.post('/reset/' + token, data={
'password': 'newpassword',
'password_confirm': 'newpassword'
}, follow_redirects=True)

assert get_message('PASSWORD_RESET') in response.data


@pytest.mark.settings(reset_url='/custom_reset')
def test_custom_reset_url(client):
response = client.get('/custom_reset')
Expand Down

0 comments on commit c10c905

Please sign in to comment.