'Overridden method to replicate (part of) the actual
creation of ccx courses'

def make_ccx(self, max_students_allowed=200):

    ccx = super(CcxDetailTest, self).make_ccx(max_students_allowed=max_students_allowed)
    ccx.structure_json = json.dumps(self.master_course_chapters)
    ccx.save()
    today = datetime.today()
    start = today.replace(tzinfo=pytz.UTC)
    override_field_for_ccx(ccx, self.course, 'start', start)
    override_field_for_ccx(ccx, self.course, 'due', None)
    hidden = 'visible_to_staff_only'
    for chapter in self.course.get_children():
        override_field_for_ccx(ccx, chapter, hidden, True)
        for sequential in chapter.get_children():
            override_field_for_ccx(ccx, sequential, hidden, True)
            for vertical in sequential.get_children():
                override_field_for_ccx(ccx, vertical, hidden, True)
    ccx_course_key = CCXLocator.from_course_locator(self.course.id, ccx.id)
    email_params = get_email_params(self.course, auto_enroll=True, course_key=ccx_course_key, display_name=ccx.display_name)
    enroll_email(course_id=ccx_course_key, student_email=self.coach.email, auto_enroll=True, email_students=False, email_params=email_params)
    return ccx
