Пример #1
0
 def test_to_cookieval_vary(self):
     middleware = self._makeOne('secret', 'thecookiename')
     middleware.vary = ('REMOTE_ADDR', 'HTTP_USER_AGENT', 'NONEXISTENT')
     environ = {'REMOTE_ADDR': '127.0.0.1', 'HTTP_USER_AGENT': 'Fluzbox'}
     browser_id = middleware.new(0)
     cookie_val = middleware.to_cookieval(environ, browser_id)
     self._assertCookieVal(cookie_val, secret='secret127.0.0.1Fluzbox')
Пример #2
0
 def test_to_cookieval_vary(self):
     middleware = self._makeOne('secret', 'thecookiename')
     middleware.vary = ('REMOTE_ADDR', 'HTTP_USER_AGENT', 'NONEXISTENT')
     environ = {'REMOTE_ADDR':'127.0.0.1', 'HTTP_USER_AGENT':'Fluzbox'}
     browser_id = middleware.new(0)
     cookie_val = middleware.to_cookieval(environ, browser_id)
     self._assertCookieVal(cookie_val, secret='secret127.0.0.1Fluzbox')
Пример #3
0
 def test_new(self):
     middleware = self._makeOne('secret', 'thecookiename')
     browser_id = middleware.new(0)
     self._assertBrowserId(browser_id)
Пример #4
0
 def test_new(self):
     middleware = self._makeOne('secret', 'thecookiename')
     browser_id = middleware.new(0)
     self._assertBrowserId(browser_id)