'Create content experiment.
Assign Group Configuration to the experiment if cid is provided.
Assigns a problem to the first group in the split test if group_id and cid_for_problem is provided.'

def _create_content_experiment(self, cid=(-1), group_id=None, cid_for_problem=None, name_suffix='', special_characters=''):

    sequential = ItemFactory.create(category='sequential', parent_location=self.course.location, display_name='Test    Subsection    {}'.format(name_suffix))
    vertical = ItemFactory.create(category='vertical', parent_location=sequential.location, display_name='Test    Unit    {}'.format(name_suffix))
    c0_url = self.course.id.make_usage_key('vertical', 'split_test_cond0')
    c1_url = self.course.id.make_usage_key('vertical', 'split_test_cond1')
    c2_url = self.course.id.make_usage_key('vertical', 'split_test_cond2')
    split_test = ItemFactory.create(category='split_test', parent_location=vertical.location, user_partition_id=cid, display_name=u'Test    Content    Experiment    {}{}'.format(name_suffix, special_characters), group_id_to_child={'0': c0_url, '1': c1_url, '2': c2_url})
    ItemFactory.create(parent_location=split_test.location, category='vertical', display_name='Condition    0    vertical', location=c0_url)
    c1_vertical = ItemFactory.create(parent_location=split_test.location, category='vertical', display_name='Condition    1    vertical', location=c1_url)
    ItemFactory.create(parent_location=split_test.location, category='vertical', display_name='Condition    2    vertical', location=c2_url)
    problem = None
    if (group_id and cid_for_problem):
        problem = ItemFactory.create(category='problem', parent_location=c1_vertical.location, display_name=u'Test    Problem')
        self.client.ajax_post(reverse_usage_url('xblock_handler', problem.location), data={'metadata': {'group_access': {cid_for_problem: [group_id]}}})
        c1_vertical.children.append(problem.location)
    partitions_json = [p.to_json() for p in self.course.user_partitions]
    self.client.ajax_post(reverse_usage_url('xblock_handler', split_test.location), data={'metadata': {'user_partitions': partitions_json}})
    self.save_course()
    return (vertical, split_test, problem)
