From be172045ed6abf6c5c6f18fe36baf1993b954c22 Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Tue, 9 Feb 2016 13:04:23 -0800 Subject: [PATCH] Fix test path encoding --- channels/tests/test_handler.py | 4 ++-- channels/tests/test_request.py | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/channels/tests/test_handler.py b/channels/tests/test_handler.py index 192c036..2289c06 100644 --- a/channels/tests/test_handler.py +++ b/channels/tests/test_handler.py @@ -46,7 +46,7 @@ class HandlerTests(SimpleTestCase): "reply_channel": "test", "http_version": "1.1", "method": "GET", - "path": "/test/", + "path": b"/test/", }, "test") response = HttpResponse(b"Hi there!", content_type="text/plain") # Run the handler @@ -74,7 +74,7 @@ class HandlerTests(SimpleTestCase): "reply_channel": "test", "http_version": "1.1", "method": "GET", - "path": "/test/", + "path": b"/test/", }, "test") response = HttpResponse(b"Thefirstthirtybytesisrighthereandhereistherest") # Run the handler diff --git a/channels/tests/test_request.py b/channels/tests/test_request.py index 3cf4601..ea2fb0f 100644 --- a/channels/tests/test_request.py +++ b/channels/tests/test_request.py @@ -28,7 +28,7 @@ class RequestTests(SimpleTestCase): "reply_channel": "test-reply", "http_version": "1.1", "method": "GET", - "path": "/test/", + "path": b"/test/", }, "test") request = AsgiRequest(message) self.assertEqual(request.path, "/test/") @@ -52,7 +52,7 @@ class RequestTests(SimpleTestCase): "reply_channel": "test", "http_version": "1.1", "method": "GET", - "path": "/test2/", + "path": b"/test2/", "query_string": b"x=1&y=foo%20bar+baz", "headers": { "host": b"example.com", @@ -85,7 +85,7 @@ class RequestTests(SimpleTestCase): "reply_channel": "test", "http_version": "1.1", "method": "POST", - "path": "/test2/", + "path": b"/test2/", "query_string": b"django=great", "body": b"ponies=are+awesome", "headers": { @@ -115,7 +115,7 @@ class RequestTests(SimpleTestCase): "reply_channel": "test", "http_version": "1.1", "method": "POST", - "path": "/test/", + "path": b"/test/", "body": b"there_a", "body_channel": "test-input", "headers": { @@ -155,7 +155,7 @@ class RequestTests(SimpleTestCase): "reply_channel": "test", "http_version": "1.1", "method": "POST", - "path": "/test/", + "path": b"/test/", "body_channel": "test-input", "headers": { "content-type": b"multipart/form-data; boundary=BOUNDARY",