'Creates cohorts for testing'

def _create_cohorts(self):

    self.cohort1_users = [UserFactory() for _ in range(3)]
    self.cohort2_users = [UserFactory() for _ in range(2)]
    self.cohort3_users = [UserFactory() for _ in range(2)]
    self.cohort4_users = [UserFactory() for _ in range(2)]
    self.cohortless_users = [UserFactory() for _ in range(3)]
    self.unenrolled_users = [UserFactory() for _ in range(3)]
    self._enroll_users(((((self.cohort1_users + self.cohort2_users) + self.cohort3_users) + self.cohortless_users) + self.cohort4_users), self.course.id)
    self.cohort1 = CohortFactory(course_id=self.course.id, users=self.cohort1_users)
    self.cohort2 = CohortFactory(course_id=self.course.id, users=self.cohort2_users)
    self.cohort3 = CohortFactory(course_id=self.course.id, users=self.cohort3_users)
    self.cohort4 = CohortFactory(course_id=self.course.id, users=self.cohort4_users)
    CourseCohortFactory(course_user_group=self.cohort1)
    CourseCohortFactory(course_user_group=self.cohort2)
    CourseCohortFactory(course_user_group=self.cohort3)
    CourseCohortFactory(course_user_group=self.cohort4, assignment_type=CourseCohort.RANDOM)
