-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: change emails name for individual_emails
- Loading branch information
1 parent
9adfd5c
commit c0dc16b
Showing
7 changed files
with
23 additions
and
29 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
18 changes: 0 additions & 18 deletions
18
lms/djangoapps/bulk_email/migrations/0009_alter_target_target_type.py
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -420,7 +420,7 @@ def setUp(self): | |
('update_forum_role_membership', | ||
{'unique_student_identifier': self.user.email, 'rolename': 'Moderator', 'action': 'allow'}), | ||
('list_forum_members', {'rolename': FORUM_ROLE_COMMUNITY_TA}), | ||
('send_email', {'send_to': '["staff"]', 'subject': 'test', 'message': 'asdf'}), | ||
('send_email', {'send_to': '["staff"]', 'individual_learners_emails': '[]' ,'subject': 'test', 'message': 'asdf'}), | ||
('list_instructor_tasks', {}), | ||
('instructor_api_v1:list_instructor_tasks', {}), | ||
('list_background_email_tasks', {}), | ||
|
@@ -3409,6 +3409,7 @@ def setUp(self): | |
test_message = '\u6824 test message' | ||
self.full_test_message = { | ||
'send_to': '["myself", "staff"]', | ||
'individual_learners_emails': '[]', | ||
'subject': test_subject, | ||
'message': test_message, | ||
} | ||
|
@@ -3444,6 +3445,16 @@ def test_send_email_but_course_not_exist(self): | |
response = self.client.post(url, self.full_test_message) | ||
assert response.status_code != 200 | ||
|
||
def test_send_email_to_individual_learners_emails(self): | ||
url = reverse('send_email', kwargs={'course_id': str(self.course.id)}) | ||
response = self.client.post(url, { | ||
'send_to': '["individual-learners"]', | ||
'individual_learners_emails': '["[email protected]"]', | ||
'subject': 'test subject', | ||
'message': 'test message', | ||
}) | ||
assert response.status_code == 200 | ||
|
||
def test_send_email_no_sendto(self): | ||
url = reverse('send_email', kwargs={'course_id': str(self.course.id)}) | ||
response = self.client.post(url, { | ||
|
@@ -3456,6 +3467,7 @@ def test_send_email_invalid_sendto(self): | |
url = reverse('send_email', kwargs={'course_id': str(self.course.id)}) | ||
response = self.client.post(url, { | ||
'send_to': '["invalid_target", "staff"]', | ||
'individual_learners_emails': '[]', | ||
'subject': 'test subject', | ||
'message': 'test message', | ||
}) | ||
|
@@ -3519,7 +3531,7 @@ def test_send_email_with_schedule(self, mock_task_api): | |
response = self.client.post(url, self.full_test_message) | ||
|
||
assert response.status_code == 200 | ||
_, _, _, arg_schedule = mock_task_api.call_args.args | ||
_, _, _, arg_schedule, _ = mock_task_api.call_args.args | ||
assert arg_schedule == expected_schedule | ||
|
||
@patch("lms.djangoapps.instructor.views.api.task_api.submit_bulk_course_email") | ||
|
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