[text] add second argument to 'parse_query_list()' (#7138)
return only values whose name is in 'as_list' as a list
This commit is contained in:
@@ -109,7 +109,7 @@ __tests__ = (
|
||||
},
|
||||
|
||||
{
|
||||
"#url" : "https://itaku.ee/home/images?tags=%2Bcute&tags=-cute&tags=~cute&maturity_rating=SFW&date_range=&ordering=-date_added",
|
||||
"#url" : "https://itaku.ee/home/images?tags=cute&tags=-cute&tags=~cute&maturity_rating=SFW&date_range=&ordering=-date_added",
|
||||
"#comment" : "search with postive, negative, and optional tags",
|
||||
"#category": ("", "itaku", "search"),
|
||||
"#class" : itaku.ItakuSearchExtractor,
|
||||
|
||||
@@ -431,10 +431,10 @@ class TestText(unittest.TestCase):
|
||||
self.assertEqual(f("foo=1&bar&baz=3"), {"foo": "1", "baz": "3"})
|
||||
|
||||
# keys with identical names
|
||||
self.assertEqual(f("foo=1&foo=2"), {"foo": ["1", "2"]})
|
||||
self.assertEqual(f("foo=1&foo=2", ("foo",)), {"foo": ["1", "2"]})
|
||||
self.assertEqual(
|
||||
f("foo=1&bar=2&foo=3&bar=4&foo=5"),
|
||||
{"foo": ["1", "3", "5"], "bar": ["2", "4"]},
|
||||
f("foo=1&bar=2&foo=3&bar=4&foo=5", {"foo", "baz"}),
|
||||
{"foo": ["1", "3", "5"], "bar": "2"},
|
||||
)
|
||||
|
||||
# invalid arguments
|
||||
|
||||
Reference in New Issue
Block a user