-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
If the user tries to remove their email from the waiting list after b…
…eing invited then ship them to the settings/account page.
- Loading branch information
1 parent
69a2753
commit a8780c0
Showing
7 changed files
with
54 additions
and
9 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 |
---|---|---|
|
@@ -194,6 +194,23 @@ def test_bad_token_data_email_not_in_list(self, with_db, with_client, make_waiti | |
with with_db() as db: | ||
assert not db.query(models.WaitingList).filter(models.WaitingList.email == email).first() | ||
|
||
def test_already_is_a_subscriber(self, with_db, with_client, make_waiting_list, make_basic_subscriber, make_invite): | ||
"""Someone is who already a subscriber should be notified to delete their accounts in the settings page!""" | ||
email = '[email protected]' | ||
|
||
sub = make_basic_subscriber(email=email) | ||
invite = make_invite(subscriber_id=sub.id) | ||
_waiting_list = make_waiting_list(email=email, invite_id=invite.id) | ||
|
||
serializer = URLSafeSerializer(os.getenv('SIGNED_SECRET'), 'waiting-list') | ||
confirm_token = serializer.dumps({'email': email, 'action': WaitingListAction.LEAVE.value}) | ||
|
||
response = with_client.post('/waiting-list/action', json={'token': confirm_token}) | ||
|
||
# Ensure the response was okay! | ||
assert response.status_code == 200, response.json() | ||
assert response.json() == { "action": WaitingListAction.LEAVE.value, "success": False, "redirectToSettings": True } | ||
|
||
|
||
class TestWaitingListAdminView: | ||
def test_view_with_admin(self, with_client, with_db, with_l10n, make_waiting_list): | ||
|
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