'Helper method to set up group configurations to content experiment.
Arguments:
partition_id (int): User partition id.'

def setup_and_verify_content_experiment(self, partition_id):

    split_test = self.get_item_from_modulestore(self.split_test_usage_key, verify_is_draft=True)
    self.assertEqual(split_test.user_partition_id, (-1))
    self.assertEqual(len(split_test.children), 0)
    self.client.ajax_post(reverse_usage_url('xblock_handler', self.split_test_usage_key), data={'metadata': {'user_partition_id': str(partition_id)}})
    split_test = self.get_item_from_modulestore(self.split_test_usage_key, verify_is_draft=True)
    self.assertEqual(split_test.user_partition_id, partition_id)
    self.assertEqual(len(split_test.children), len(self.course.user_partitions[partition_id].groups))
    return split_test
