Example #1
0
 def test_nonexistent_course(self):
     """
     Tests exception when the course in the email doesn't exist
     """
     course_id = CourseLocator("I", "DONT", "EXIST")
     email = CourseEmail(course_id=course_id)
     email.save()
     entry = InstructorTask.create(course_id, "task_type", "task_key",
                                   "task_input", self.instructor)
     task_input = {"email_id": email.id}
     with pytest.raises(CourseRunNotFound):
         perform_delegate_email_batches(entry.id, course_id, task_input,
                                        "action_name")
Example #2
0
 def test_nonexistent_course(self):
     """
     Tests exception when the course in the email doesn't exist
     """
     course_id = CourseLocator("I", "DONT", "EXIST")
     email = CourseEmail(course_id=course_id)
     email.save()
     entry = InstructorTask.create(course_id, "task_type", "task_key",
                                   "task_input", self.instructor)
     task_input = {"email_id": email.id}
     # (?i) is a regex for ignore case
     with self.assertRaisesRegex(ValueError, r"(?i)course not found"):
         perform_delegate_email_batches(entry.id, course_id, task_input,
                                        "action_name")