'Test deleting a draft vertical which has a published version.'

@ddt.data((ModuleStoreEnum.Type.mongo, 4, 1), (ModuleStoreEnum.Type.split, 2, 2))
@ddt.unpack
def test_delete_draft_vertical(self, default_ms, max_find, max_send):

    self.initdb(default_ms)
    private_vert = self.store.create_child(self.user_id, self.course_locations[self.MONGO_COURSEID], 'vertical', block_id='publish')
    private_leaf = self.store.create_child(self.user_id, private_vert.location, 'html', block_id='bug_leaf')
    with self.assertRaises(UnsupportedRevisionError):
        self.store.delete_item(private_leaf.location, self.user_id, revision=ModuleStoreEnum.RevisionOption.draft_preferred)
    self.store.publish(private_vert.location, self.user_id)
    private_leaf.display_name = 'change    me'
    private_leaf = self.store.update_item(private_leaf, self.user_id)
    if ((default_ms == ModuleStoreEnum.Type.mongo) and mongo_uses_error_check(self.store)):
        max_find += 1
    with check_mongo_calls(max_find, max_send):
        self.store.delete_item(private_leaf.location, self.user_id)
