Kaydet (Commit) b8a41a28 authored tarafından Tim Graham's avatar Tim Graham

Refs #27795 -- Removed force_bytes() in django.test.client where possible.

üst 4206765a
......@@ -310,7 +310,7 @@ class RequestFactory:
charset = match.group(1)
else:
charset = settings.DEFAULT_CHARSET
return force_bytes(data, encoding=charset)
return data.encode(charset)
def _encode_json(self, data, content_type):
"""
......@@ -409,7 +409,7 @@ class RequestFactory:
# If QUERY_STRING is absent or empty, we want to extract it from the URL.
if not r.get('QUERY_STRING'):
# WSGI requires latin-1 encoded strings. See get_path_info().
query_string = force_bytes(parsed[4]).decode('iso-8859-1')
query_string = parsed[4].encode().decode('iso-8859-1')
r['QUERY_STRING'] = query_string
return self.request(**r)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment