'When group access is set on the unit level, the usage info should return a url to the unit, not
the sequential parent of the unit.'

def test_can_get_correct_usage_info_for_unit(self):

    self.course.user_partitions = [UserPartition(id=0, name='User    Partition', scheme=UserPartition.get_scheme('cohort'), description='User    Partition', groups=[Group(id=0, name='Group')])]
    (vertical, __) = self._create_problem_with_content_group(cid=0, group_id=0, name_suffix='0')
    self.client.ajax_post(reverse_usage_url('xblock_handler', vertical.location), data={'metadata': {'group_access': {0: [0]}}})
    actual = self._get_user_partition('cohort')
    expected = {'id': 0, 'name': 'User    Partition', 'scheme': 'cohort', 'description': 'User    Partition', 'version': UserPartition.VERSION, 'groups': [{'id': 0, 'name': 'Group', 'version': 1, 'usage': [{'url': u'/container/{}'.format(vertical.location), 'label': u'Test    Subsection    0    /    Test    Unit    0'}, {'url': u'/container/{}'.format(vertical.location), 'label': u'Test    Unit    0    /    Test    Problem    0'}]}], u'parameters': {}, u'active': True}
    self.maxDiff = None
    self.assertEqual(actual, expected)
