fix issue where request.args.pop removed parameters inconsistently (#2112)

Co-authored-by: Adam Hopkins <admhpkns@gmail.com>
This commit is contained in:
Arthur Goldberg
2021-04-22 11:49:08 +02:00
committed by GitHub
parent 35c76253bf
commit cbb77b536a
2 changed files with 23 additions and 6 deletions

View File

@@ -289,6 +289,17 @@ def test_query_string(app):
assert request.args.getlist("test1") == ["1"]
assert request.args.get("test3", default="My value") == "My value"
def test_popped_stays_popped(app):
@app.route("/")
async def handler(request):
return text("OK")
request, response = app.test_client.get(
"/", params=[("test1", "1")]
)
assert request.args.pop("test1") == ["1"]
assert "test1" not in request.args
@pytest.mark.asyncio
async def test_query_string_asgi(app):