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

Function test_form_data_ordering

tests/test_wrappers.py:1011–1025  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1009
1010@pytest.mark.filterwarnings("ignore:'OrderedMultiDict':DeprecationWarning")
1011def test_form_data_ordering():
1012 class MyRequest(wrappers.Request):
1013 parameter_storage_class = _ImmutableOrderedMultiDict
1014
1015 req = MyRequest.from_values("/?foo=1&bar=0&foo=3")
1016 assert list(req.args) == ["foo", "bar"]
1017 assert list(req.args.items(multi=True)) == [
1018 ("foo", "1"),
1019 ("bar", "0"),
1020 ("foo", "3"),
1021 ]
1022 assert isinstance(req.args, _ImmutableOrderedMultiDict)
1023 assert isinstance(req.values, CombinedMultiDict)
1024 assert req.values["foo"] == "1"
1025 assert req.values.getlist("foo") == ["1", "3"]
1026
1027
1028def test_values():

Callers

nothing calls this directly

Calls 4

from_valuesMethod · 0.80
listFunction · 0.50
itemsMethod · 0.45
getlistMethod · 0.45

Tested by

no test coverage detected