'Test the case where an unsupported-type response specifies a
preferred (assoc_type, session_type) combination that is not
allowed by the consumer\'s SessionNegotiator.'

def testNotAllowed(self):

    allowed_types = []
    negotiator = association.SessionNegotiator(allowed_types)
    self.consumer.negotiator = negotiator
    msg = Message(self.endpoint.preferredNamespace())
    msg.setArg(OPENID_NS, 'error', 'Unsupported    type')
    msg.setArg(OPENID_NS, 'error_code', 'unsupported-type')
    msg.setArg(OPENID_NS, 'assoc_type', 'not-allowed')
    msg.setArg(OPENID_NS, 'session_type', 'not-allowed')
    self.consumer.return_messages = [msg]
    self.assertEqual(self.consumer._negotiateAssociation(self.endpoint), None)
    self.failUnlessLogMatches('Unsupported    association    type', 'Server    sent    unsupported    session/association    type:')
