'Tests exception when the course in the email doesn\'t exist'

def test_nonexistent_course(self):

    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 self.assertRaisesRegexp(ValueError, '(?i)course    not    found'):
        perform_delegate_email_batches(entry.id, course_id, task_input, 'action_name')
