def _wsgi_env(self, with_credentials=True):
     url = 'http://server.example'
     if not with_credentials:
         return create_wsgi_environ(url, 'POST')
     return create_wsgi_environ(url + login_handler_url,
                                'POST',
                                request_body={
                                    'login': '******',
                                    'password': '******'
                                })
Beispiel #2
0
 def _wsgi_env(self, cookie_plugin=None):
     with_cookie = (cookie_plugin is not None)
     env = create_wsgi_environ('http://server.example', 'GET')
     if with_cookie:
         cookie_plugin = self._cookie_plugin()
         identity = {'repoze.who.userid': 20}
         headers = cookie_plugin.remember(env.copy(), identity)
         assert_length(3, headers)  # multiple headers for different paths
         cookie_value = headers[0][1]
         env['HTTP_COOKIE'] = cookie_value
         return env
     return env
Beispiel #3
0
 def _wsgi_env(self, cookie_plugin=None):
     with_cookie = (cookie_plugin is not None)
     env = create_wsgi_environ('http://server.example', 'GET')
     if with_cookie:
         cookie_plugin = self._cookie_plugin()
         identity = {'repoze.who.userid': 20}
         headers = cookie_plugin.remember(env.copy(), identity)
         assert_length(3, headers) # multiple headers for different paths
         cookie_value = headers[0][1]
         env['HTTP_COOKIE'] = cookie_value
         return env
     return env
 def _wsgi_env(self, with_credentials=True):
     url = 'http://server.example'
     if not with_credentials:
         return create_wsgi_environ(url, 'POST')
     return create_wsgi_environ(url + login_handler_url, 'POST',
         request_body={'login': '******', 'password': '******'})