Skip to content

Commit

Permalink
fix: debug tests
Browse files Browse the repository at this point in the history
  • Loading branch information
evemartin committed Apr 9, 2024
1 parent 6abe884 commit e829610
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions portal/tests/test_teacher_student.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import absolute_import

import json
from unittest.mock import Mock, patch

import pytest
from common.models import JoinReleaseStudent
Expand Down Expand Up @@ -528,7 +529,8 @@ def test_move(self):
page = page.logout().go_to_teacher_login_page().login(email_2, password_2).open_classes_tab().go_to_class_page()
assert page.student_exists(student_name_1)

def test_dismiss(self):
@patch("common.helpers.emails.send_dotdigital_email")
def test_dismiss(self, mock_send_dotdigital_email: Mock):
email, password = signup_teacher_directly()
create_organisation_directly(email)
_, _, access_code = create_class_directly(email)
Expand Down Expand Up @@ -557,7 +559,10 @@ def test_dismiss(self):
assert len(logs) == 1
assert logs[0].action_type == JoinReleaseStudent.RELEASE

def test_multiple_dismiss(self):
mock_send_dotdigital_email.assert_called()

@patch("common.helpers.emails.send_dotdigital_email")
def test_multiple_dismiss(self, mock_send_dotdigital_email: Mock):
email, password = signup_teacher_directly()
create_organisation_directly(email)
_, _, access_code = create_class_directly(email)
Expand Down Expand Up @@ -597,3 +602,5 @@ def test_multiple_dismiss(self):

# student should still exist
assert page.student_exists(student_name_2)

mock_send_dotdigital_email.assert_called()

0 comments on commit e829610

Please sign in to comment.