'Test .allow() with an OpenID 1.x Message on a CheckIDRequest
built without an op_endpoint parameter.'

def test_answerAllowNoEndpointOpenID1(self):

    identity = 'http://bambam.unittest/'
    reqmessage = Message.fromOpenIDArgs({'identity': identity, 'trust_root': 'http://bar.unittest/', 'return_to': 'http://bar.unittest/999'})
    self.request = server.CheckIDRequest.fromMessage(reqmessage, None)
    answer = self.request.answer(True)
    expected_list = [('mode', 'id_res'), ('return_to', self.request.return_to), ('identity', identity)]
    for (k, expected) in expected_list:
        actual = answer.fields.getArg(OPENID_NS, k)
        self.failUnlessEqual(expected, actual, ('%s:    expected    %s,    got    %s' % (k, expected, actual)))
    self.failUnless(answer.fields.hasKey(OPENID_NS, 'response_nonce'))
    self.failUnlessEqual(answer.fields.getOpenIDNamespace(), OPENID1_NS)
    self.failUnless(answer.fields.namespaces.isImplicit(OPENID1_NS))
    self.failUnlessEqual(len(answer.fields.toPostArgs()), (len(expected_list) + 1), answer.fields.toPostArgs())
