'Complete an OpenID authentication request.'

def complete(self, openid_response):

    openid_response.whichEncoding = (lambda : ENCODE_URL)
    webresponse = self.provider.server.encodeResponse(openid_response)
    self.assertEquals(webresponse.code, 302)
    redirect_to = webresponse.headers['location']
    self.assertTrue(redirect_to.startswith('http://testserver/openid/complete/'))
    return self.client.get('/openid/complete/', dict(cgi.parse_qsl(redirect_to.split('?', 1)[1])))
