generated from ocadotechnology/codeforlife-template-backend
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eada4c2
commit c0ea52a
Showing
8 changed files
with
35 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -403,42 +403,21 @@ def test_verify_email_address(self): | |
user = User.objects.filter(userprofile__is_verified=False).first() | ||
assert user | ||
|
||
self.client.get( | ||
self.reverse_action( | ||
"verify_email_address", | ||
model=user, | ||
kwargs={ | ||
"token": email_verification_token_generator.make_token(user) | ||
}, | ||
), | ||
status_code_assertion=status.HTTP_303_SEE_OTHER, | ||
) | ||
|
||
user.refresh_from_db() | ||
assert user.userprofile.is_verified | ||
|
||
def test_verify_new_email_address(self): | ||
"""Can verify a user's new email address following email change | ||
request.""" | ||
user = User.objects.filter(userprofile__is_verified=True).first() | ||
assert user | ||
|
||
new_email = "[email protected]" | ||
|
||
self.client.get( | ||
self.reverse_action( | ||
"verify_email_address", | ||
model=user, | ||
kwargs={ | ||
"token": email_verification_token_generator.make_token( | ||
user, new_email=new_email | ||
) | ||
"token": email_verification_token_generator.make_token(user, new_email) | ||
}, | ||
), | ||
status_code_assertion=status.HTTP_303_SEE_OTHER, | ||
) | ||
|
||
user.refresh_from_db() | ||
assert user.userprofile.is_verified | ||
assert user.email == new_email | ||
assert user.username == new_email | ||
|
||
|
@@ -480,7 +459,7 @@ def test_create( | |
|
||
add_contact_to_dot_digital.assert_called_once() | ||
|
||
make_token.assert_called_once_with(user_id) | ||
make_token.assert_called_once_with(user_id, data["email"]) | ||
|
||
send_mail_mock.assert_called_once_with( | ||
campaign_id=settings.DOTDIGITAL_CAMPAIGN_IDS[ | ||
|
@@ -620,7 +599,7 @@ def test_send_verify_email_reminder( | |
if mail_sent: | ||
make_token.assert_has_calls( | ||
[ | ||
call(user.id) | ||
call(user.id, user.email) | ||
for user in teacher_users + indy_users | ||
], | ||
any_order=True, | ||
|