'Test remove role of staff of master course on ccx course.
Specific test to check that a passed display name is in the
subject of the email sent to the unenrolled users.'

def test_remove_master_course_staff_from_ccx_display_name(self):

    staff = self.make_staff()
    self.assertTrue(CourseStaffRole(self.course.id).has_user(staff))
    instructor = self.make_instructor()
    self.assertTrue(CourseInstructorRole(self.course.id).has_user(instructor))
    outbox = self.get_outbox()
    add_master_course_staff_to_ccx(self.course, self.ccx_locator, self.ccx.display_name, send_email=False)
    display_name = 'custom_display_{}'.format(uuid.uuid4())
    list_staff_master_course = list_with_level(self.course, 'staff')
    list_instructor_master_course = list_with_level(self.course, 'instructor')
    self.assertEqual(len(outbox), 0)
    remove_master_course_staff_from_ccx(self.course, self.ccx_locator, display_name)
    self.assertEqual(len(outbox), (len(list_staff_master_course) + len(list_instructor_master_course)))
    for email in outbox:
        self.assertIn(display_name, email.subject)
