(self)
| 177 | 'Set-Cookie: val="some\\054funky\\073stuff"') |
| 178 | |
| 179 | def test_special_attrs(self): |
| 180 | # 'expires' |
| 181 | C = cookies.SimpleCookie('Customer="WILE_E_COYOTE"') |
| 182 | C['Customer']['expires'] = 0 |
| 183 | # can't test exact output, it always depends on current date/time |
| 184 | self.assertEndsWith(C.output(), 'GMT') |
| 185 | |
| 186 | # loading 'expires' |
| 187 | C = cookies.SimpleCookie() |
| 188 | C.load('Customer="W"; expires=Wed, 01 Jan 2010 00:00:00 GMT') |
| 189 | self.assertEqual(C['Customer']['expires'], |
| 190 | 'Wed, 01 Jan 2010 00:00:00 GMT') |
| 191 | C = cookies.SimpleCookie() |
| 192 | C.load('Customer="W"; expires=Wed, 01 Jan 98 00:00:00 GMT') |
| 193 | self.assertEqual(C['Customer']['expires'], |
| 194 | 'Wed, 01 Jan 98 00:00:00 GMT') |
| 195 | |
| 196 | # 'max-age' |
| 197 | C = cookies.SimpleCookie('Customer="WILE_E_COYOTE"') |
| 198 | C['Customer']['max-age'] = 10 |
| 199 | self.assertEqual(C.output(), |
| 200 | 'Set-Cookie: Customer="WILE_E_COYOTE"; Max-Age=10') |
| 201 | |
| 202 | def test_set_secure_httponly_attrs(self): |
| 203 | C = cookies.SimpleCookie('Customer="WILE_E_COYOTE"') |
nothing calls this directly
no test coverage detected