MCPcopy
hub / github.com/django/django / test_custom_iterable_not_doseq

Method test_custom_iterable_not_doseq

tests/utils_tests/test_http.py:47–55  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

45 self.assertEqual(urlencode({"a": (1, 2)}, doseq=False), "a=%281%2C+2%29")
46
47 def test_custom_iterable_not_doseq(self):
48 class IterableWithStr:
49 def __str__(self):
50 return "custom"
51
52 def __iter__(self):
53 yield from range(0, 3)
54
55 self.assertEqual(urlencode({"a": IterableWithStr()}, doseq=False), "a=custom")
56
57 def test_dict_containing_sequence_doseq(self):
58 self.assertEqual(urlencode({"a": [1, 2]}, doseq=True), "a=1&a=2")

Callers

nothing calls this directly

Calls 2

urlencodeFunction · 0.90
IterableWithStrClass · 0.85

Tested by

no test coverage detected