'Change divided discussion settings for the current course.
If dividing by cohorts, create and assign users to a cohort.'

def change_divided_discussion_settings(self, scheme):

    enable_cohorts = (True if (scheme is CourseDiscussionSettings.COHORT) else False)
    set_course_discussion_settings(self.course.id, enable_cohorts=enable_cohorts, divided_discussions=[], always_divide_inline_discussions=True, division_scheme=scheme)
    set_course_cohorted(self.course.id, enable_cohorts)
