(self)
| 281 | 'Set-Cookie: eggs=scrambled; Path=bar; Secure\r\nSet-Cookie: foo=foo') |
| 282 | |
| 283 | def test_quoted_meta(self): |
| 284 | # Try cookie with quoted meta-data |
| 285 | C = cookies.SimpleCookie() |
| 286 | C.load('Customer="WILE_E_COYOTE"; Version="1"; Path="/acme"') |
| 287 | self.assertEqual(C['Customer'].value, 'WILE_E_COYOTE') |
| 288 | self.assertEqual(C['Customer']['version'], '1') |
| 289 | self.assertEqual(C['Customer']['path'], '/acme') |
| 290 | |
| 291 | self.assertEqual(C.output(['path']), |
| 292 | 'Set-Cookie: Customer="WILE_E_COYOTE"; Path=/acme') |
| 293 | self.assertEqual(C.js_output(), r""" |
| 294 | <script type="text/javascript"> |
| 295 | <!-- begin hiding |
| 296 | document.cookie = "Customer=\"WILE_E_COYOTE\"; Path=/acme; Version=1"; |
| 297 | // end hiding --> |
| 298 | </script> |
| 299 | """) |
| 300 | self.assertEqual(C.js_output(['path']), r""" |
| 301 | <script type="text/javascript"> |
| 302 | <!-- begin hiding |
| 303 | document.cookie = "Customer=\"WILE_E_COYOTE\"; Path=/acme"; |
| 304 | // end hiding --> |
| 305 | </script> |
| 306 | """) |
| 307 | |
| 308 | def test_invalid_cookies(self): |
| 309 | # Accepting these could be a security issue |
nothing calls this directly
no test coverage detected