Ejemplo n.º 1
0
 def test_httponly_after_load(self):
     """
     Test that we can use httponly attribute on cookies that we load
     """
     c = SimpleCookie()
     c.load("name=val")
     c['name']['httponly'] = True
     self.assertTrue(c['name']['httponly'])
Ejemplo n.º 2
0
 def test_encode(self):
     """
     Test that we don't output tricky characters in encoded value
     """
     c = SimpleCookie()
     c['test'] = "An,awkward;value"
     self.assertTrue(";" not in c.output().rstrip(';')) # IE compat
     self.assertTrue("," not in c.output().rstrip(';')) # Safari compat
Ejemplo n.º 3
0
 def test_decode_2(self):
     """
     Test that we haven't broken normal encoding
     """
     c = SimpleCookie()
     c['test'] = b"\xf0"
     c2 = SimpleCookie()
     c2.load(c.output())
     self.assertEqual(c['test'].value, c2['test'].value)
Ejemplo n.º 4
0
 def test_decode(self):
     """
     Test that we can still preserve semi-colons and commas
     """
     c = SimpleCookie()
     c['test'] = "An,awkward;value"
     c2 = SimpleCookie()
     c2.load(c.output())
     self.assertEqual(c['test'].value, c2['test'].value)