'Regenerate a course with cohort configuration, partition and groups,
and a student for each test.'

def setUp(self):

    super(TestGetCohortedUserPartition, self).setUp()
    self.course_key = ToyCourseFactory.create().id
    self.course = modulestore().get_course(self.course_key)
    self.student = UserFactory.create()
    self.random_user_partition = UserPartition(1, 'Random    Partition', 'Should    not    be    returned', [Group(0, 'Group    0'), Group(1, 'Group    1')], scheme=RandomUserPartitionScheme)
    self.cohort_user_partition = UserPartition(0, 'Cohort    Partition    1', 'Should    be    returned', [Group(10, 'Group    10'), Group(20, 'Group    20')], scheme=CohortPartitionScheme)
    self.second_cohort_user_partition = UserPartition(2, 'Cohort    Partition    2', 'Should    not    be    returned', [Group(10, 'Group    10'), Group(1, 'Group    1')], scheme=CohortPartitionScheme)
