'Request an assoc type that is not supported when there are
supported types.
Should give back an error message with a fallback type.'

def test_associate3(self):

    self.server.negotiator.setAllowedTypes([('HMAC-SHA256', 'DH-SHA256')])
    msg = Message.fromPostArgs({'openid.ns': OPENID2_NS, 'openid.session_type': 'no-encryption'})
    request = server.AssociateRequest.fromMessage(msg)
    response = self.server.openid_associate(request)
    self.failUnless(response.fields.hasKey(OPENID_NS, 'error'))
    self.failUnless(response.fields.hasKey(OPENID_NS, 'error_code'))
    self.failIf(response.fields.hasKey(OPENID_NS, 'assoc_handle'))
    self.failUnlessEqual(response.fields.getArg(OPENID_NS, 'assoc_type'), 'HMAC-SHA256')
    self.failUnlessEqual(response.fields.getArg(OPENID_NS, 'session_type'), 'DH-SHA256')
