예제 #1
0
파일: tests.py 프로젝트: farcaller/django
 def test_encode(self):
     """
     Test that we don't output tricky characters in encoded value
     """
     c = CompatCookie()
     c['test'] = "An,awkward;value"
     self.assert_(";" not in c.output()) # IE compat
     self.assert_("," not in c.output()) # Safari compat
예제 #2
0
파일: tests.py 프로젝트: 0xmilk/appscale
 def test_decode_2(self):
     """
     Test that we haven't broken normal encoding
     """
     c = CompatCookie()
     c['test'] = "\xf0"
     c2 = CompatCookie()
     c2.load(c.output())
     self.assertEqual(c['test'].value, c2['test'].value)
예제 #3
0
파일: tests.py 프로젝트: 0xmilk/appscale
 def test_decode(self):
     """
     Test that we can still preserve semi-colons and commas
     """
     c = CompatCookie()
     c['test'] = "An,awkward;value"
     c2 = CompatCookie()
     c2.load(c.output())
     self.assertEqual(c['test'].value, c2['test'].value)
예제 #4
0
 def test_decode_2(self):
     """
     Test that we haven't broken normal encoding
     """
     c = CompatCookie()
     c['test'] = "\xf0"
     c2 = CompatCookie()
     c2.load(c.output())
     self.assertEqual(c['test'].value, c2['test'].value)
예제 #5
0
 def test_decode(self):
     """
     Test that we can still preserve semi-colons and commas
     """
     c = CompatCookie()
     c['test'] = "An,awkward;value"
     c2 = CompatCookie()
     c2.load(c.output())
     self.assertEqual(c['test'].value, c2['test'].value)
예제 #6
0
파일: tests.py 프로젝트: 0xmilk/appscale
 def test_encode(self):
     """
     Test that we don't output tricky characters in encoded value
     """
     # Python 2.4 compatibility note: Python 2.4's cookie implementation
     # always returns Set-Cookie headers terminating in semi-colons.
     # That's not the bug this test is looking for, so ignore it.
     c = CompatCookie()
     c['test'] = "An,awkward;value"
     self.assert_(";" not in c.output().rstrip(';')) # IE compat
     self.assert_("," not in c.output().rstrip(';')) # Safari compat
예제 #7
0
 def test_encode(self):
     """
     Test that we don't output tricky characters in encoded value
     """
     # Python 2.4 compatibility note: Python 2.4's cookie implementation
     # always returns Set-Cookie headers terminating in semi-colons.
     # That's not the bug this test is looking for, so ignore it.
     c = CompatCookie()
     c['test'] = "An,awkward;value"
     self.assert_(";" not in c.output().rstrip(';'))  # IE compat
     self.assert_("," not in c.output().rstrip(';'))  # Safari compat