'Test the resource backend call delete_projects_from_ids.
Tests the normal flow of the delete_projects_from_ids backend call,
that ensures no project on the list exists after it is successfully
called.'

def test_delete_projects_from_ids(self):

    project1_ref = unit.new_project_ref(domain_id=CONF.identity.default_domain_id)
    project2_ref = unit.new_project_ref(domain_id=CONF.identity.default_domain_id)
    projects = (project1_ref, project2_ref)
    for project in projects:
        self.resource_api.create_project(project['id'], project)
    projects_ids = [p['id'] for p in projects]
    self.resource_api.driver.delete_projects_from_ids(projects_ids)
    for project_id in projects_ids:
        self.assertRaises(exception.ProjectNotFound, self.resource_api.driver.get_project, project_id)
    self.resource_api.driver.delete_projects_from_ids([])
