Skip to content

Commit 72c88f9

Browse files
nburnsorsenthil
andcommitted
Update Lib/test/test_http_cookies.py
Co-authored-by: Senthil Kumaran <[email protected]>
1 parent fe3e63f commit 72c88f9

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

Lib/test/test_http_cookies.py

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,27 @@ def test_basic(self):
5050
))
5151
},
5252

53-
{'data': 'cookie="{"key": "value"}"',
54-
'dict': {'cookie': '{"key": "value"}'},
55-
'repr': "<SimpleCookie: cookie='{\"key\": \"value\"}'>",
56-
'output': 'Set-Cookie: cookie="{"key": "value"}"',
53+
# gh-92936: allow double quote in cookie values
54+
{
55+
'data': 'cookie="{"key": "value"}"',
56+
'dict': {'cookie': '{"key": "value"}'},
57+
'repr': "<SimpleCookie: cookie='{\"key\": \"value\"}'>",
58+
'output': 'Set-Cookie: cookie="{"key": "value"}"',
5759
},
58-
59-
{'data': 'key="some value; surrounded by quotes"',
60-
'dict': {'key': 'some value; surrounded by quotes'},
61-
'repr': "<SimpleCookie: key='some value; surrounded by quotes'>",
62-
'output': 'Set-Cookie: key="some value; surrounded by quotes"',
60+
{
61+
'data': 'key="some value; surrounded by quotes"',
62+
'dict': {'key': 'some value; surrounded by quotes'},
63+
'repr': "<SimpleCookie: key='some value; surrounded by quotes'>",
64+
'output': 'Set-Cookie: key="some value; surrounded by quotes"',
65+
},
66+
{
67+
'data': 'session="user123"; preferences="{"theme": "dark"}"',
68+
'dict': {'session': 'user123', 'preferences': '{"theme": "dark"}'},
69+
'repr': "<SimpleCookie: preferences='{\"theme\": \"dark\"}' session='user123'>",
70+
'output': '\n'.join((
71+
'Set-Cookie: preferences="{"theme": "dark"}"',
72+
'Set-Cookie: session="user123"',
73+
))
6374
}
6475
]
6576

0 commit comments

Comments
 (0)