'Test delete_projects_from_ids issues warning if not found.
Tests the resource backend call delete_projects_from_ids passing a
non existing ID in project_ids, which is logged and ignored by
the backend.'

def test_delete_projects_from_ids_with_no_existing_project_id(self):

    project_ref = unit.new_project_ref(domain_id=CONF.identity.default_domain_id)
    self.resource_api.create_project(project_ref['id'], project_ref)
    projects_ids = (project_ref['id'], uuid.uuid4().hex)
    with mock.patch('keystone.resource.backends.sql.LOG') as mock_log:
        self.resource_api.delete_projects_from_ids(projects_ids)
        self.assertTrue(mock_log.warning.called)
    self.assertRaises(exception.ProjectNotFound, self.resource_api.driver.get_project, project_ref['id'])
    self.resource_api.driver.delete_projects_from_ids([uuid.uuid4().hex])
