'Test calling revert_to_published on draft vertical.'

@ddt.data(ModuleStoreEnum.Type.mongo, ModuleStoreEnum.Type.split)
def test_revert_to_published_root_draft(self, default_ms):

    self.initdb(default_ms)
    self._create_block_hierarchy()
    vertical = self.store.get_item(self.vertical_x1a)
    vertical_children_num = len(vertical.children)
    self.store.publish(self.course.location, self.user_id)
    self.assertFalse(self._has_changes(self.vertical_x1a))
    self.store.delete_item(self.problem_x1a_1, self.user_id)
    self.assertTrue(self._has_changes(self.vertical_x1a))
    draft_parent = self.store.get_item(self.vertical_x1a)
    self.assertEqual((vertical_children_num - 1), len(draft_parent.children))
    published_parent = self.store.get_item(self.vertical_x1a, revision=ModuleStoreEnum.RevisionOption.published_only)
    self.assertEqual(vertical_children_num, len(published_parent.children))
    self.store.revert_to_published(self.vertical_x1a, self.user_id)
    reverted_parent = self.store.get_item(self.vertical_x1a)
    self.assertEqual(vertical_children_num, len(published_parent.children))
    self.assertBlocksEqualByFields(reverted_parent, published_parent)
    self.assertFalse(self._has_changes(self.vertical_x1a))
