Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
mentors.debian.net
debexpo
Commits
6453d37e
Verified
Commit
6453d37e
authored
Jan 06, 2022
by
Baptiste Beauplat
Browse files
Add a test to cover using an invalid email reset link to second reset call
parent
7f1391be
Changes
1
Show whitespace changes
Inline
Side-by-side
tests/functional/accounts/test_update_email.py
View file @
6453d37e
...
@@ -176,7 +176,8 @@ class TestUpdateEmail(TransactionTestController):
...
@@ -176,7 +176,8 @@ class TestUpdateEmail(TransactionTestController):
self
.
_submit_token
(
token
,
'new@example.org'
,
self
.
_submit_token
(
token
,
'new@example.org'
,
error
=
'address already exists'
)
error
=
'address already exists'
)
def
test_update_email_invalid_taken
(
self
):
def
test_update_email_invalid_token
(
self
):
# On first call
invalid_data
=
{
invalid_data
=
{
'uidb64'
:
'a'
,
'uidb64'
:
'a'
,
'token'
:
'x-x'
,
'token'
:
'x-x'
,
...
@@ -186,6 +187,17 @@ class TestUpdateEmail(TransactionTestController):
...
@@ -186,6 +187,17 @@ class TestUpdateEmail(TransactionTestController):
self
.
_submit_token
(
None
,
'new@example.org'
,
self
.
_submit_token
(
None
,
'new@example.org'
,
invalid
=
True
,
submit_data
=
invalid_data
)
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
):
def
test_update_email_mismatch_email
(
self
):
token
=
self
.
_get_update_token
(
'new@example.org'
)
token
=
self
.
_get_update_token
(
'new@example.org'
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment