Skip to content

Commit

Permalink
Merge branch 'master' into admin_daily_activity
Browse files Browse the repository at this point in the history
  • Loading branch information
faucomte97 authored May 8, 2024
2 parents 34c0c27 + 0f4aca6 commit 0a3951e
Show file tree
Hide file tree
Showing 14 changed files with 180 additions and 194 deletions.
50 changes: 0 additions & 50 deletions cfl_common/common/email_messages.py

This file was deleted.

5 changes: 5 additions & 0 deletions cfl_common/common/mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@
"delete_account": 1567477,
"email_change_notification": 1551600,
"email_change_verification": 1551594,
"invite_teacher_with_account": 1569599,
"invite_teacher_without_account": 1569607,
"level_creation": 1570259,
"reset_password": 1557153,
"student_join_request_notification": 1569486,
"student_join_request_rejected": 1569470,
"student_join_request_sent": 1569477,
"teacher_released": 1569537,
"user_already_registered": 1569539,
"verify_new_user": 1551577,
"verify_new_user_first_reminder": 1557170,
"verify_new_user_second_reminder": 1557173,
Expand Down
13 changes: 2 additions & 11 deletions cfl_common/common/tests/utils/email.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,15 @@ def follow_verify_email_link_to_login(page, url, user_type):
return go_to_independent_student_login_page(page.browser)


def follow_duplicate_account_link_to_login(page, email, user_type):
_follow_duplicate_account_email_link(page, email)
def follow_duplicate_account_link_to_login(page, url, user_type):
page.browser.get(url)

if user_type == "teacher":
return go_to_teacher_login_page(page.browser)
elif user_type == "independent":
return go_to_independent_student_login_page(page.browser)


def _follow_duplicate_account_email_link(page, email):
message = str(email.message())
prefix = 'please login: <a href="'
i = str.find(message, prefix) + len(prefix)
suffix = '" rel="nofollow">'
j = str.find(message, suffix, i)
page.browser.get(message[i:j])


def follow_reset_email_link(browser, link):
browser.get(link)

Expand Down
18 changes: 0 additions & 18 deletions cfl_common/common/tests/utils/student.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from common.helpers.emails import generate_token
from common.helpers.generators import generate_login_id
from common.models import Class, Student
from django.core import mail

from . import email

Expand Down Expand Up @@ -102,23 +101,6 @@ def generate_independent_student_details():
generate_independent_student_details.next_id = 1


def signup_duplicate_independent_student_fail(page, duplicate_email=None):
page = page.go_to_signup_page()

name, username, email_address, password = generate_independent_student_details()

if not duplicate_email:
duplicate_email = email_address

page = page.independent_student_signup(name, duplicate_email, password=password, confirm_password=password)

page = page.return_to_home_page()

page = email.follow_duplicate_account_link_to_login(page, mail.outbox[0], "independent")

return page, name, username, email_address, password


@patch("common.helpers.emails.send_dotdigital_email")
def create_independent_student(page, mock_send_dotdigital_email):
page = page.go_to_signup_page()
Expand Down
9 changes: 5 additions & 4 deletions cfl_common/common/tests/utils/teacher.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from common.helpers.emails import generate_token
from common.models import Teacher
from django.core import mail

from . import email

Expand Down Expand Up @@ -34,16 +33,18 @@ def signup_teacher_directly(preverified=True, **kwargs):
return email_address, password


def signup_duplicate_teacher_fail(page, duplicate_email):
@patch("portal.views.home.send_dotdigital_email")
def signup_duplicate_teacher_fail(page, duplicate_email, mock_send_dotdigital_email):
page = page.go_to_signup_page()

first_name, last_name, email_address, password = generate_details()
page = page.signup(first_name, last_name, duplicate_email, password, password)

page = page.return_to_home_page()

page = email.follow_duplicate_account_link_to_login(page, mail.outbox[0], "teacher")
mail.outbox = []
login_link = mock_send_dotdigital_email.call_args.kwargs["personalization_values"]["LOGIN_URL"]

page = email.follow_duplicate_account_link_to_login(page, login_link, "teacher")

return page, email_address, password

Expand Down
2 changes: 1 addition & 1 deletion portal/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "6.43.2"
__version__ = "6.44.0"
Binary file modified portal/static/portal/img/10_years_anniversary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 0a3951e

Please sign in to comment.