MCPcopy
hub / github.com/django/django / test_non_default_encoding

Method test_non_default_encoding

tests/httpwrappers/tests.py:249–260  ·  view source on GitHub ↗

#13572 - QueryDict with a non-default encoding

(self)

Source from the content-addressed store, hash-verified

247 self.assertEqual(x.getlist("a"), ["1", "2", "3", "4"])
248
249 def test_non_default_encoding(self):
250 """#13572 - QueryDict with a non-default encoding"""
251 q = QueryDict("cur=%A4", encoding="iso-8859-15")
252 self.assertEqual(q.encoding, "iso-8859-15")
253 self.assertEqual(list(q.items()), [("cur", "€")])
254 self.assertEqual(q.urlencode(), "cur=%A4")
255 q = q.copy()
256 self.assertEqual(q.encoding, "iso-8859-15")
257 self.assertEqual(list(q.items()), [("cur", "€")])
258 self.assertEqual(q.urlencode(), "cur=%A4")
259 self.assertEqual(copy.copy(q).encoding, "iso-8859-15")
260 self.assertEqual(copy.deepcopy(q).encoding, "iso-8859-15")
261
262 def test_querydict_fromkeys(self):
263 self.assertEqual(

Callers

nothing calls this directly

Calls 5

urlencodeMethod · 0.95
copyMethod · 0.95
QueryDictClass · 0.90
itemsMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected