'Check that when an OpenID 2 response exceeds the OpenID 1
message size, a POST response (i.e., an HTML form) is
returned.'

def test_id_res_OpenID2_POST(self):

    request = server.CheckIDRequest(identity='http://bombom.unittest/', trust_root='http://burr.unittest/', return_to='http://burr.unittest/999', immediate=False, op_endpoint=self.server.op_endpoint)
    request.message = Message(OPENID2_NS)
    response = server.OpenIDResponse(request)
    response.fields = Message.fromOpenIDArgs({'ns': OPENID2_NS, 'mode': 'id_res', 'identity': request.identity, 'claimed_id': request.identity, 'return_to': ('x' * OPENID1_URL_LIMIT)})
    self.failUnless(response.renderAsForm())
    self.failUnless((len(response.encodeToURL()) > OPENID1_URL_LIMIT))
    self.failUnless((response.whichEncoding() == server.ENCODE_HTML_FORM))
    webresponse = self.encode(response)
    self.failUnlessEqual(webresponse.body, response.toFormMarkup())
