summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_http_cookies.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_http_cookies.py')
-rw-r--r--Lib/test/test_http_cookies.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_http_cookies.py b/Lib/test/test_http_cookies.py
index 447f883..6072c7e 100644
--- a/Lib/test/test_http_cookies.py
+++ b/Lib/test/test_http_cookies.py
@@ -220,6 +220,16 @@ class CookieTests(unittest.TestCase):
with self.assertRaises(cookies.CookieError):
C.load(rawdata)
+ def test_comment_quoting(self):
+ c = cookies.SimpleCookie()
+ c['foo'] = '\N{COPYRIGHT SIGN}'
+ self.assertEqual(str(c['foo']), 'Set-Cookie: foo="\\251"')
+ c['foo']['comment'] = 'comment \N{COPYRIGHT SIGN}'
+ self.assertEqual(
+ str(c['foo']),
+ 'Set-Cookie: foo="\\251"; Comment="comment \\251"'
+ )
+
class MorselTests(unittest.TestCase):
"""Tests for the Morsel object."""