(self)
| 144 | self.assertEqual(len(value), n + 3) |
| 145 | |
| 146 | def test_load(self): |
| 147 | C = cookies.SimpleCookie() |
| 148 | C.load('Customer="WILE_E_COYOTE"; Version=1; Path=/acme') |
| 149 | |
| 150 | self.assertEqual(C['Customer'].value, 'WILE_E_COYOTE') |
| 151 | self.assertEqual(C['Customer']['version'], '1') |
| 152 | self.assertEqual(C['Customer']['path'], '/acme') |
| 153 | |
| 154 | self.assertEqual(C.output(['path']), |
| 155 | 'Set-Cookie: Customer="WILE_E_COYOTE"; Path=/acme') |
| 156 | self.assertEqual(C.js_output(), r""" |
| 157 | <script type="text/javascript"> |
| 158 | <!-- begin hiding |
| 159 | document.cookie = "Customer=\"WILE_E_COYOTE\"; Path=/acme; Version=1"; |
| 160 | // end hiding --> |
| 161 | </script> |
| 162 | """) |
| 163 | self.assertEqual(C.js_output(['path']), r""" |
| 164 | <script type="text/javascript"> |
| 165 | <!-- begin hiding |
| 166 | document.cookie = "Customer=\"WILE_E_COYOTE\"; Path=/acme"; |
| 167 | // end hiding --> |
| 168 | </script> |
| 169 | """) |
| 170 | |
| 171 | def test_extended_encode(self): |
| 172 | # Issue 9824: some browsers don't follow the standard; we now |
nothing calls this directly
no test coverage detected