diff --git a/portal/tests/test_independent_student.py b/portal/tests/test_independent_student.py index ca78b1760..a81886d1a 100644 --- a/portal/tests/test_independent_student.py +++ b/portal/tests/test_independent_student.py @@ -21,7 +21,6 @@ from django.urls import reverse from selenium.webdriver.common.by import By from selenium.webdriver.support.wait import WebDriverWait -from unittest.mock import ANY from portal.forms.error_messages import INVALID_LOGIN_MESSAGE @@ -138,8 +137,7 @@ 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(mocker): - mocked_send = mocker.patch("common.mail.send_dotdigital_email") + def test_signup_under_13_sends_parent_email(self): c = Client() response = c.post( @@ -158,7 +156,8 @@ def test_signup_under_13_sends_parent_email(mocker): ) assert response.status_code == 302 - mocked_send.assert_called_once_with(1551587, ANY, ANY) + assert len(mail.outbox) == 1 + assert mail.outbox[0].subject == "Code for Life account request" # Class for Selenium tests. We plan to replace these and turn them into Cypress tests