'Tests that a staff member can masquerade as being in a particular group
when that staff member also belongs to a cohort with a corresponding
group.'

@skip_unless_lms
@patch.dict('django.conf.settings.FEATURES', {'DISABLE_START_DATES': False})
def test_group_masquerade_with_cohort(self):

    self.course.cohort_config = {'cohorted': True}
    modulestore().update_item(self.course, self.test_user.id)
    cohort = CohortFactory.create(course_id=self.course.id, users=[self.test_user])
    CourseUserGroupPartitionGroup(course_user_group=cohort, partition_id=self.user_partition.id, group_id=self.user_partition.groups[0].id).save()
    self._verify_masquerade_for_all_groups()
