'Test error handling when an error occurs during backup deletion.'

def test_delete_backup_with_error(self):

    vol_id = self._create_volume_db_entry(size=1)
    backup = self._create_backup_db_entry(status=fields.BackupStatus.DELETING, display_name='fail_on_delete', volume_id=vol_id)
    self.assertRaises(IOError, self.backup_mgr.delete_backup, self.ctxt, backup)
    backup = db.backup_get(self.ctxt, backup.id)
    self.assertEqual(fields.BackupStatus.ERROR, backup['status'])
