'Create the course modes required for a test.'

def _create_course_modes(self, course_modes, course=None):

    course_id = (course.id if course else self.course.id)
    for mode_slug in course_modes:
        CourseModeFactory.create(course_id=course_id, mode_slug=mode_slug, mode_display_name=mode_slug)
