summaryrefslogtreecommitdiff
path: root/tests/httpwrappers
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2017-02-07 12:05:47 -0500
committerTim Graham <timograham@gmail.com>2017-02-09 09:03:47 -0500
commit500532c95db40b0b24654be7bb0d76b66b022bd5 (patch)
tree761766d7138652703e566ac9c96960a265f036ff /tests/httpwrappers
parent21f13ff5b3d5a42d62f38398c010efcdce30dad7 (diff)
downloaddjango-500532c95db40b0b24654be7bb0d76b66b022bd5.tar.gz
Refs #23919 -- Removed default 'utf-8' argument for str.encode()/decode().
Diffstat (limited to 'tests/httpwrappers')
-rw-r--r--tests/httpwrappers/tests.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/httpwrappers/tests.py b/tests/httpwrappers/tests.py
index 800b584fe5..b3ad3b49dd 100644
--- a/tests/httpwrappers/tests.py
+++ b/tests/httpwrappers/tests.py
@@ -317,7 +317,7 @@ class HttpResponseTests(unittest.TestCase):
with self.assertRaises(UnicodeError):
r.__setitem__('føø', 'bar')
with self.assertRaises(UnicodeError):
- r.__setitem__('føø'.encode('utf-8'), 'bar')
+ r.__setitem__('føø'.encode(), 'bar')
def test_long_line(self):
# Bug #20889: long lines trigger newlines to be added to headers
@@ -371,7 +371,7 @@ class HttpResponseTests(unittest.TestCase):
# test odd inputs
r = HttpResponse()
r.content = ['1', '2', 3, '\u079e']
- # '\xde\x9e' == unichr(1950).encode('utf-8')
+ # '\xde\x9e' == unichr(1950).encode()
self.assertEqual(r.content, b'123\xde\x9e')
# .content can safely be accessed multiple times.
@@ -573,7 +573,7 @@ class StreamingHttpResponseTests(SimpleTestCase):
# iterating over strings still yields bytestring chunks.
r.streaming_content = iter(['hello', 'café'])
chunks = list(r)
- # '\xc3\xa9' == unichr(233).encode('utf-8')
+ # '\xc3\xa9' == unichr(233).encode()
self.assertEqual(chunks, [b'hello', b'caf\xc3\xa9'])
for chunk in chunks:
self.assertIsInstance(chunk, bytes)