'Verify authenticate to a domain with unsafe name fails.'

def test_create_domain_token_fails_if_domain_name_unsafe(self):

    self.config_fixture.config(group='resource', domain_name_url_safe='off')
    unsafe_name = 'i    am    not    /    safe'
    domain = unit.new_domain_ref(name=unsafe_name)
    self.resource_api.create_domain(domain['id'], domain)
    role_member = unit.new_role_ref()
    self.role_api.create_role(role_member['id'], role_member)
    self.assignment_api.create_grant(role_member['id'], user_id=self.user['id'], domain_id=domain['id'])
    auth_data = self.build_authentication_request(user_id=self.user['id'], password=self.user['password'], domain_name=domain['name'])
    self.v3_create_token(auth_data)
    self.config_fixture.config(group='resource', project_name_url_safe='new')
    self.v3_create_token(auth_data)
    self.config_fixture.config(group='resource', domain_name_url_safe='strict')
    self.v3_create_token(auth_data, expected_status=http_client.UNAUTHORIZED)
