'Test get_project_by_name works when the domain_id is None.'

@unit.skip_if_no_multiple_domains_support
def test_get_project_by_name_for_project_acting_as_a_domain(self):

    project = unit.new_project_ref(domain_id=CONF.identity.default_domain_id, is_domain=False)
    project = self.resource_api.create_project(project['id'], project)
    self.assertRaises(exception.ProjectNotFound, self.resource_api.get_project_by_name, project['name'], None)
    project2 = unit.new_project_ref(is_domain=True, name=project['name'])
    project2 = self.resource_api.create_project(project2['id'], project2)
    project_ref = self.resource_api.get_project_by_name(project2['name'], None)
    self.assertEqual(project2, project_ref)
