(self)
| 542 | assert val == "foo=bar; Domain=xn--n3h.com; Path=/" |
| 543 | |
| 544 | def test_cookie_unicode_dumping(self): |
| 545 | val = http.dump_cookie("foo", "\N{SNOWMAN}") |
| 546 | h = datastructures.Headers() |
| 547 | h.add("Set-Cookie", val) |
| 548 | assert h["Set-Cookie"] == 'foo="\\342\\230\\203"; Path=/' |
| 549 | |
| 550 | cookies = http.parse_cookie(h["Set-Cookie"]) |
| 551 | assert cookies["foo"] == "\N{SNOWMAN}" |
| 552 | |
| 553 | def test_cookie_unicode_keys(self): |
| 554 | # Yes, this is technically against the spec but happens |