This repository has been archived by the owner on Feb 8, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 308
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
1cb9a52
commit 1180ddb
Showing
2 changed files
with
14 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -209,22 +209,27 @@ def test_john_is_plural(self): | |
assert actual == expected | ||
|
||
def test_can_change_email(self): | ||
self.alice.update_email('[email protected]') | ||
self.alice.change_email('[email protected]') | ||
expected = '[email protected]' | ||
actual = self.alice.email.address | ||
assert actual == expected | ||
|
||
def test_cannot_confirm_email_in_one_step(self): | ||
self.alice.update_email('[email protected]', True) | ||
actual = self.alice.email.confirmed | ||
assert actual == False | ||
|
||
def test_can_confirm_email_in_second_step(self): | ||
def test_can_verify_email(self): | ||
self.alice.update_email('[email protected]') | ||
self.alice.update_email('[email protected]', True) | ||
actual = self.alice.email.confirmed | ||
hash_string = Participant.from_username('alice').email.hash | ||
self.alice.verify_email(hash_string) | ||
actual = Participant.from_username('alice').email.confirmed | ||
assert actual == True | ||
|
||
def test_cannot_verify_email_with_wrong_hash(self): | ||
self.alice.update_email('[email protected]') | ||
hash_string = "some wrong hash" | ||
self.alice.verify_email(hash_string) | ||
actual = Participant.from_username('alice').email.confirmed | ||
assert actual == False | ||
|
||
# TODO - Add a test for expired hashes. (We don't have control over the ctime of emails) | ||
|
||
def test_cant_take_over_claimed_participant_without_confirmation(self): | ||
with self.assertRaises(NeedConfirmation): | ||
self.alice.take_over(('twitter', str(self.bob.id))) | ||
|