diff options
author | Claude Paroz <claude@2xlibre.net> | 2016-12-29 16:27:49 +0100 |
---|---|---|
committer | Claude Paroz <claude@2xlibre.net> | 2017-01-18 20:18:46 +0100 |
commit | 7b2f2e74adb36a4334e83130f6abc2f79d395235 (patch) | |
tree | 313387ba6a6f1311b43cf5fb4f2576d2d6c4f805 /tests/httpwrappers | |
parent | f6acd1d271122d66de8061e75ae26137ddf02658 (diff) | |
download | django-7b2f2e74adb36a4334e83130f6abc2f79d395235.tar.gz |
Refs #23919 -- Removed six.<various>_types usage
Thanks Tim Graham and Simon Charette for the reviews.
Diffstat (limited to 'tests/httpwrappers')
-rw-r--r-- | tests/httpwrappers/tests.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/httpwrappers/tests.py b/tests/httpwrappers/tests.py index 9042f8ed6e..b8d359de41 100644 --- a/tests/httpwrappers/tests.py +++ b/tests/httpwrappers/tests.py @@ -578,7 +578,7 @@ class StreamingHttpResponseTests(SimpleTestCase): chunks = list(r) self.assertEqual(chunks, [b'hello', b'world']) for chunk in chunks: - self.assertIsInstance(chunk, six.binary_type) + self.assertIsInstance(chunk, bytes) # and the response can only be iterated once. self.assertEqual(list(r), []) @@ -595,7 +595,7 @@ class StreamingHttpResponseTests(SimpleTestCase): # '\xc3\xa9' == unichr(233).encode('utf-8') self.assertEqual(chunks, [b'hello', b'caf\xc3\xa9']) for chunk in chunks: - self.assertIsInstance(chunk, six.binary_type) + self.assertIsInstance(chunk, bytes) # streaming responses don't have a `content` attribute. self.assertFalse(hasattr(r, 'content')) @@ -616,8 +616,7 @@ class StreamingHttpResponseTests(SimpleTestCase): # coercing a streaming response to bytes doesn't return a complete HTTP # message like a regular response does. it only gives us the headers. r = StreamingHttpResponse(iter(['hello', 'world'])) - self.assertEqual( - six.binary_type(r), b'Content-Type: text/html; charset=utf-8') + self.assertEqual(bytes(r), b'Content-Type: text/html; charset=utf-8') # and this won't consume its content. self.assertEqual(list(r), [b'hello', b'world']) |