Verified Commit 6453d37e authored by Baptiste Beauplat's avatar Baptiste Beauplat
Browse files

Add a test to cover using an invalid email reset link to second reset call

parent 7f1391be
......@@ -176,7 +176,8 @@ class TestUpdateEmail(TransactionTestController):
self._submit_token(token, 'new@example.org',
error='address already exists')
def test_update_email_invalid_taken(self):
def test_update_email_invalid_token(self):
# On first call
invalid_data = {
'uidb64': 'a',
'token': 'x-x',
......@@ -186,6 +187,17 @@ class TestUpdateEmail(TransactionTestController):
self._submit_token(None, 'new@example.org',
invalid=True, submit_data=invalid_data)
# On redirect call
user = User.objects.get(email=self._AUTHDATA['username'])
invalid_data = {
'uidb64': urlsafe_base64_encode(force_bytes(user.pk)),
'token': 'change-email',
'email': 'another@example.org',
}
self._submit_token(None, 'new@example.org',
invalid=True, submit_data=invalid_data)
def test_update_email_mismatch_email(self):
token = self._get_update_token('new@example.org')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment