'To reproduce a bug (STUD-811) publish a vertical, convert to draft, delete a child, move a child, publish.
See if deleted and moved children still is connected or exists in db (bug was disconnected but existed)'

def test_publish_draft_delete(self):

    vert_location = self.old_course_key.make_usage_key('vertical', block_id='Vert1')
    item = self.draft_mongo.get_item(vert_location, 2)
    if mongo_uses_error_check(self.draft_mongo):
        max_find = 23
    else:
        max_find = 22
    with check_mongo_calls(max_find, 7):
        self.draft_mongo.publish(item.location, self.user_id)
    item = self.draft_mongo.get_item(vert_location, 0)
    self.assertFalse(getattr(item, 'is_draft', False), 'Item    was    published.    Draft    should    not    exist')
    location = self.old_course_key.make_usage_key('discussion', block_id='Discussion1')
    self.draft_mongo.delete_item(location, self.user_id)
    draft_vert = self.draft_mongo.get_item(vert_location, 0)
    self.assertTrue(getattr(draft_vert, 'is_draft', False), "Deletion    didn't    convert    parent    to    draft")
    self.assertNotIn(location, draft_vert.children)
    other_child_loc = self.old_course_key.make_usage_key('html', block_id='Html2')
    draft_vert.children.remove(other_child_loc)
    other_vert = self.draft_mongo.get_item(self.old_course_key.make_usage_key('vertical', block_id='Vert2'), 0)
    other_vert.children.append(other_child_loc)
    self.draft_mongo.update_item(draft_vert, self.user_id)
    self.draft_mongo.update_item(other_vert, self.user_id)
    self.draft_mongo.publish(vert_location, self.user_id)
    item = self.draft_mongo.get_item(draft_vert.location, revision=ModuleStoreEnum.RevisionOption.published_only)
    self.assertNotIn(location, item.children)
    self.assertIsNone(self.draft_mongo.get_parent_location(location))
    with self.assertRaises(ItemNotFoundError):
        self.draft_mongo.get_item(location)
    self.assertNotIn(other_child_loc, item.children)
    self.assertTrue(self.draft_mongo.has_item(other_child_loc), 'Oops,    lost    moved    item')
