mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
#8826: the "expires" attribute value is a date string with spaces, but apparently not all user-agents put it in quotes. Handle that as a special case.
This commit is contained in:
parent
bda4672b01
commit
b16e38b825
3 changed files with 14 additions and 0 deletions
|
|
@ -76,6 +76,16 @@ class CookieTests(unittest.TestCase):
|
|||
# can't test exact output, it always depends on current date/time
|
||||
self.assertTrue(C.output().endswith('GMT'))
|
||||
|
||||
# loading 'expires'
|
||||
C = cookies.SimpleCookie()
|
||||
C.load('Customer="W"; expires=Wed, 01-Jan-2010 00:00:00 GMT')
|
||||
self.assertEqual(C['Customer']['expires'],
|
||||
'Wed, 01-Jan-2010 00:00:00 GMT')
|
||||
C = cookies.SimpleCookie()
|
||||
C.load('Customer="W"; expires=Wed, 01-Jan-98 00:00:00 GMT')
|
||||
self.assertEqual(C['Customer']['expires'],
|
||||
'Wed, 01-Jan-98 00:00:00 GMT')
|
||||
|
||||
# 'max-age'
|
||||
C = cookies.SimpleCookie('Customer="WILE_E_COYOTE"')
|
||||
C['Customer']['max-age'] = 10
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue