(self)
| 199 | 'Set-Cookie: val="some\\054funky\\073stuff"') |
| 200 | |
| 201 | def test_special_attrs(self): |
| 202 | # 'expires' |
| 203 | C = cookies.SimpleCookie('Customer="WILE_E_COYOTE"') |
| 204 | C['Customer']['expires'] = 0 |
| 205 | # can't test exact output, it always depends on current date/time |
| 206 | self.assertEndsWith(C.output(), 'GMT') |
| 207 | |
| 208 | # loading 'expires' |
| 209 | C = cookies.SimpleCookie() |
| 210 | C.load('Customer="W"; expires=Wed, 01 Jan 2010 00:00:00 GMT') |
| 211 | self.assertEqual(C['Customer']['expires'], |
| 212 | 'Wed, 01 Jan 2010 00:00:00 GMT') |
| 213 | C = cookies.SimpleCookie() |
| 214 | C.load('Customer="W"; expires=Wed, 01 Jan 98 00:00:00 GMT') |
| 215 | self.assertEqual(C['Customer']['expires'], |
| 216 | 'Wed, 01 Jan 98 00:00:00 GMT') |
| 217 | |
| 218 | # 'max-age' |
| 219 | C = cookies.SimpleCookie('Customer="WILE_E_COYOTE"') |
| 220 | C['Customer']['max-age'] = 10 |
| 221 | self.assertEqual(C.output(), |
| 222 | 'Set-Cookie: Customer="WILE_E_COYOTE"; Max-Age=10') |
| 223 | |
| 224 | def test_set_secure_httponly_attrs(self): |
| 225 | C = cookies.SimpleCookie('Customer="WILE_E_COYOTE"') |
nothing calls this directly
no test coverage detected