From 4b6b409d853a1fab1dd76226517171aa882c83c9 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Sun, 23 Jun 2019 08:59:10 -0700 Subject: [PATCH] Test harness simulates raw_path/path properly This causes tests to fail. --- tests/fixtures.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/fixtures.py b/tests/fixtures.py index 875382d0..c5f2bfd4 100644 --- a/tests/fixtures.py +++ b/tests/fixtures.py @@ -12,6 +12,7 @@ import sys import string import tempfile import time +from urllib.parse import unquote class TestResponse: @@ -50,7 +51,8 @@ class TestClient: "type": "http", "http_version": "1.0", "method": "GET", - "path": path, + "path": unquote(path), + "raw_path": path.encode("ascii"), "query_string": query_string, "headers": [[b"host", b"localhost"]], },