-
Notifications
You must be signed in to change notification settings - Fork 81
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
Showing
1 changed file
with
16 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -138,24 +138,24 @@ def test_signup_invalid_name_fails(self): | |
# Assert response isn't a redirect (submit failure) | ||
assert response.status_code == 200 | ||
|
||
def test_signup_under_13_sends_parent_email(self): | ||
@patch("common.mail.send_dotdigital_email") | ||
def test_signup_under_13_sends_parent_email(self, mock_send_dotdigital_email): | ||
c = Client() | ||
|
||
with patch("common.mail.send_dotdigital_email") as mock_send_dotdigital_email: | ||
response = c.post( | ||
reverse("register"), | ||
{ | ||
"independent_student_signup-date_of_birth_day": datetime.date.today().day, | ||
"independent_student_signup-date_of_birth_month": datetime.date.today().month, | ||
"independent_student_signup-date_of_birth_year": datetime.date.today().year, | ||
"independent_student_signup-name": "Young person", | ||
"independent_student_signup-email": "[email protected]", | ||
"independent_student_signup-consent_ticked": "on", | ||
"independent_student_signup-password": "$RRFVBGT%6yhnmju7", | ||
"independent_student_signup-confirm_password": "$RRFVBGT%6yhnmju7", | ||
"g-recaptcha-response": "something", | ||
}, | ||
) | ||
response = c.post( | ||
reverse("register"), | ||
{ | ||
"independent_student_signup-date_of_birth_day": datetime.date.today().day, | ||
"independent_student_signup-date_of_birth_month": datetime.date.today().month, | ||
"independent_student_signup-date_of_birth_year": datetime.date.today().year, | ||
"independent_student_signup-name": "Young person", | ||
"independent_student_signup-email": "[email protected]", | ||
"independent_student_signup-consent_ticked": "on", | ||
"independent_student_signup-password": "$RRFVBGT%6yhnmju7", | ||
"independent_student_signup-confirm_password": "$RRFVBGT%6yhnmju7", | ||
"g-recaptcha-response": "something", | ||
}, | ||
) | ||
|
||
assert response.status_code == 302 | ||
mock_send_dotdigital_email.assert_called_once_with(1551587, ANY, ANY) | ||
|