'Sets up the initial data into the db'

@staticmethod
def bootstrapDB(split_store):

    for (_course_id, course_spec) in SplitModuleTest.COURSE_CONTENT.iteritems():
        course = split_store.create_course(course_spec['org'], course_spec['course'], course_spec['run'], course_spec['user_id'], master_branch=BRANCH_NAME_DRAFT, fields=course_spec['fields'], root_block_id=course_spec['root_block_id'])
        for revision in course_spec.get('revisions', []):
            for ((block_type, block_id), fields) in revision.get('update', {}).iteritems():
                if (course.location.block_id == block_id):
                    block = course
                else:
                    block_usage = BlockUsageLocator.make_relative(course.location, block_type, block_id)
                    block = split_store.get_item(block_usage)
                for (key, value) in fields.iteritems():
                    setattr(block, key, value)
            new_ele_dict = {}
            for spec in revision.get('create', []):
                if (spec['parent'] in new_ele_dict):
                    parent = new_ele_dict.get(spec['parent'])
                elif (spec['parent'] == course.location.block_id):
                    parent = course
                else:
                    block_usage = BlockUsageLocator.make_relative(course.location, spec['parent_type'], spec['parent'])
                    parent = split_store.get_item(block_usage)
                block_id = LocalId(spec['id'])
                child = split_store.create_xblock(course.runtime, course.id, spec['category'], block_id, spec['fields'], parent_xblock=parent)
                new_ele_dict[spec['id']] = child
            course = split_store.persist_xblock_dag(course, revision['user_id'])
    source_course = CourseLocator(org='testx', course='wonderful', run='run', branch=BRANCH_NAME_DRAFT)
    to_publish = BlockUsageLocator(source_course, block_type='course', block_id='head23456')
    destination = CourseLocator(org='testx', course='wonderful', run='run', branch=BRANCH_NAME_PUBLISHED)
    split_store.copy('test@edx.org', source_course, destination, [to_publish], None)
