'Create a problem
Assign content group to the problem.'

def _create_problem_with_content_group(self, cid, group_id, name_suffix='', special_characters='', orphan=False):

    vertical_parent_location = self.course.location
    if (not orphan):
        subsection = ItemFactory.create(category='sequential', parent_location=self.course.location, display_name='Test    Subsection    {}'.format(name_suffix))
        vertical_parent_location = subsection.location
    vertical = ItemFactory.create(category='vertical', parent_location=vertical_parent_location, display_name='Test    Unit    {}'.format(name_suffix))
    problem = ItemFactory.create(category='problem', parent_location=vertical.location, display_name=u'Test    Problem    {}{}'.format(name_suffix, special_characters))
    group_access_content = {'group_access': {cid: [group_id]}}
    self.client.ajax_post(reverse_usage_url('xblock_handler', problem.location), data={'metadata': group_access_content})
    if (not orphan):
        self.course.children.append(subsection.location)
    self.save_course()
    return (vertical, problem)
