From 291859c199c481bf1e304e39613ca90b6f55f9f8 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Mon, 6 Aug 2012 16:11:45 -0700 Subject: [PATCH] fix the tests for python 3 --- tests/test_requests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_requests.py b/tests/test_requests.py index 233daed1..dd08b2af 100755 --- a/tests/test_requests.py +++ b/tests/test_requests.py @@ -986,7 +986,7 @@ class RequestsTestSuite(TestSetup, TestBaseMixin, unittest.TestCase): # this attempt to iterate will crash because the content has already # been read. first_line = next(res.iter_lines()) - self.assertTrue(first_line.strip().startswith('{')) + self.assertTrue(first_line.strip().decode('utf-8').startswith('{')) def test_prefetch_return_response_interaction(self): """Test that prefetch can be overridden as a kwarg to `send`.""" @@ -994,7 +994,7 @@ class RequestsTestSuite(TestSetup, TestBaseMixin, unittest.TestCase): req.send(prefetch=False) # content should not have been prefetched, and iter_lines should succeed first_line = next(req.response.iter_lines()) - self.assertTrue(first_line.strip().startswith('{')) + self.assertTrue(first_line.strip().decode('utf-8').startswith('{')) if __name__ == '__main__': unittest.main()