MCPcopy
hub / github.com/pallets/werkzeug / test_cookie_unicode_dumping

Method test_cookie_unicode_dumping

tests/test_http.py:544–551  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

addMethod · 0.95

Tested by

no test coverage detected