Пример #1
0
 def test_identity_user_not_found_page_contains_name(self):
     """ Resulting page should contain the referent user name """
     name = "fred"
     page = pagetemplate.identity_user_not_found_page(name)
     expect_data = "...%(name)s..." % vars()
     page_data = page.serialise()
     self.failUnlessOutputCheckerMatch(expect_data, page_data)
Пример #2
0
 def test_identity_user_not_found_page_contains_name(self):
     """ Resulting page should contain the referent user name """
     name = "fred"
     page = pagetemplate.identity_user_not_found_page(name)
     expect_data = "...%(name)s..." % vars()
     page_data = page.serialise()
     self.failUnlessOutputCheckerMatch(expect_data, page_data)
Пример #3
0
        page = pagetemplate.about_site_view_page()
        data = self._get_page_data(page)
        response = Response(header, data)
        return response

    def _make_identity_view_response(self):
        """ Construct a response for an identity view """
        name = self.route_map['name']
        try:
            entry = self.gracie_server.auth_service.get_entry(name)
        except KeyError, e:
            entry = None

        if entry is None:
            header = ResponseHeader(http_codes["Not Found"])
            page = pagetemplate.identity_user_not_found_page(name)
        else:
            header = ResponseHeader(http_codes["OK"])
            identity_url = self._make_openid_url(name)
            page = pagetemplate.identity_view_user_page(
                entry, identity_url
                )

        data = self._get_page_data(page)
        response = Response(header, data)
        return response

    def _make_logout_response(self):
        """ Construct a response for a logout request """
        self._remove_auth_session()