コード例 #1
0
    def setUp(self):
        self.request = dummyRequest()

        id_url = util.get_view_url(self.request, views.idPage)

        # Set up the OpenID request we're responding to.
        op_endpoint = "http://127.0.0.1:8080/endpoint"
        message = Message.fromPostArgs(
            {
                "openid.mode": "checkid_setup",
                "openid.identity": id_url,
                "openid.return_to": "http://127.0.0.1/%s" % (self.id(),),
                "openid.sreg.required": "postcode",
            }
        )
        self.openid_request = CheckIDRequest.fromMessage(message, op_endpoint)

        views.set_request(self.request, self.openid_request)
コード例 #2
0
    def setUp(self):
        self.request = dummyRequest()

        id_url = util.get_view_url(self.request, views.idPage)

        # Set up the OpenID request we're responding to.
        op_endpoint = 'http://127.0.0.1:8080/endpoint'
        message = Message.fromPostArgs({
            'openid.mode':
            'checkid_setup',
            'openid.identity':
            id_url,
            'openid.return_to':
            'http://127.0.0.1/%s' % (self.id(), ),
            'openid.sreg.required':
            'postcode',
        })
        self.openid_request = CheckIDRequest.fromMessage(message, op_endpoint)

        views.set_request(self.request, self.openid_request)
コード例 #3
0
    def test_unreachableRealm(self):
        self.request = dummyRequest()

        id_url = util.get_view_url(self.request, views.idPage)

        # Set up the OpenID request we're responding to.
        op_endpoint = "http://127.0.0.1:8080/endpoint"
        message = Message.fromPostArgs(
            {
                "openid.mode": "checkid_setup",
                "openid.identity": id_url,
                "openid.return_to": "http://unreachable.invalid/%s" % (self.id(),),
                "openid.sreg.required": "postcode",
            }
        )
        self.openid_request = CheckIDRequest.fromMessage(message, op_endpoint)

        views.set_request(self.request, self.openid_request)

        response = views.show_decide_page(self.request, self.openid_request)
        self.failUnless("trust_root_valid is Unreachable" in response.content, response)
コード例 #4
0
    def test_unreachableRealm(self):
        self.request = dummyRequest()

        id_url = util.get_view_url(self.request, views.idPage)

        # Set up the OpenID request we're responding to.
        op_endpoint = 'http://127.0.0.1:8080/endpoint'
        message = Message.fromPostArgs({
            'openid.mode':
            'checkid_setup',
            'openid.identity':
            id_url,
            'openid.return_to':
            'http://unreachable.invalid/%s' % (self.id(), ),
            'openid.sreg.required':
            'postcode',
        })
        self.openid_request = CheckIDRequest.fromMessage(message, op_endpoint)

        views.set_request(self.request, self.openid_request)

        response = views.show_decide_page(self.request, self.openid_request)
        self.failUnless('trust_root_valid is Unreachable' in response.content,
                        response)