示例#1
0
 def test_gather_params_with_unicode_data(self):
     # If the currently requested URL includes a query string, the
     # parameters in the query string will be included when constructing
     # the params mapping (which is then used to complete the open ID
     # response) and if there are non-ASCII characters in the query string,
     # they are properly decoded.
     request = LaunchpadTestRequest(SERVER_URL='http://example.com',
                                    QUERY_STRING='foo=%E1%9B%9D',
                                    environ={'PATH_INFO': '/'})
     view = OpenIDCallbackView(context=None, request=None)
     params = view._gather_params(request)
     self.assertEqual(params['foo'], u'\u16dd')
示例#2
0
 def test_gather_params_with_unicode_data(self):
     # If the currently requested URL includes a query string, the
     # parameters in the query string will be included when constructing
     # the params mapping (which is then used to complete the open ID
     # response) and if there are non-ASCII characters in the query string,
     # they are properly decoded.
     request = LaunchpadTestRequest(
         SERVER_URL='http://example.com',
         QUERY_STRING='foo=%E1%9B%9D',
         environ={'PATH_INFO': '/'})
     view = OpenIDCallbackView(context=None, request=None)
     params = view._gather_params(request)
     self.assertEquals(params['foo'], u'\u16dd')
示例#3
0
 def test_gather_params(self):
     # If the currently requested URL includes a query string, the
     # parameters in the query string must be included when constructing
     # the params mapping (which is then used to complete the open ID
     # response).  OpenIDCallbackView._gather_params does that gathering.
     request = LaunchpadTestRequest(
         SERVER_URL='http://example.com',
         QUERY_STRING='foo=bar',
         form={'starting_url': 'http://launchpad.dev/after-login'},
         environ={'PATH_INFO': '/'})
     view = OpenIDCallbackView(context=None, request=None)
     params = view._gather_params(request)
     expected_params = {
         'starting_url': 'http://launchpad.dev/after-login',
         'foo': 'bar',
     }
     self.assertEquals(params, expected_params)