'Create a block of block_type (which should be a DIRECT_ONLY_CATEGORY),
and then verify that it was created successfully, and is visible in
both published and draft branches.'

def _do_create(self, block_type, with_asides=False):

    block_usage_key = self.course.id.make_usage_key(block_type, 'test_block')
    self.assertBlockDoesntExist(block_usage_key)
    self.assertCourseDoesntPointToBlock(block_usage_key)
    test_data = self.DATA_FIELDS[block_type]
    initial_field_value = test_data.initial
    with self.store.branch_setting(ModuleStoreEnum.Branch.draft_preferred):
        if self.is_detached(block_type):
            block = self.store.create_xblock(self.course.runtime, self.course.id, block_usage_key.block_type, block_id=block_usage_key.block_id)
            block.fields[test_data.field_name].write_to(block, initial_field_value)
            asides = []
            if with_asides:
                asides = self._prepare_asides(self.course.scope_ids.usage_id)
            self.store.update_item(block, ModuleStoreEnum.UserID.test, asides=asides, allow_not_found=True)
        else:
            asides = []
            if with_asides:
                asides = self._prepare_asides(self.course.scope_ids.usage_id)
            self.store.create_child(user_id=ModuleStoreEnum.UserID.test, parent_usage_key=self.course.scope_ids.usage_id, block_type=block_type, block_id=block_usage_key.block_id, fields={test_data.field_name: initial_field_value}, asides=asides)
    if self.is_detached(block_type):
        self.assertCourseDoesntPointToBlock(block_usage_key)
    else:
        self.assertCoursePointsToBlock(block_usage_key)
    if with_asides:
        self.assertBlockHasContent(block_usage_key, test_data.field_name, initial_field_value, self.ASIDE_DATA_FIELD.field_name, self.ASIDE_DATA_FIELD.initial)
    else:
        self.assertBlockHasContent(block_usage_key, test_data.field_name, initial_field_value)
    return block_usage_key
