Exemplo n.º 1
0
 def test_get_cookie_with_secret(self):
     request = Request({
         'HTTP_COOKIE':
         'foo="!VzhGFLGcW+5OMs1s4beLXaqFxAUwgHdWkH5fgapghoI='
         '?gASVDwAAAAAAAACMA2Zvb5SMA2JhcpSGlC4="'
     })
     actual = request.get_cookie("foo", secret='secretkey')
     expected = 'bar'
     self.assertEqual(actual, expected)
Exemplo n.º 2
0
 def test_get_cookie(self):
     request = Request({'HTTP_COOKIE': 'foo="bar"'})
     actual = request.get_cookie("foo")
     expected = 'bar'
     self.assertEqual(actual, expected)