From 10d23981736e0cd7d864b12cd8d12edd9a4d8b6d Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 7 Jun 2012 22:21:06 -0400 Subject: [PATCH] fix test for python3 --- 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 50bc824..00a7608 100755 --- a/tests/test_requests.py +++ b/tests/test_requests.py @@ -466,7 +466,7 @@ class RequestsTestSuite(TestSetup, TestBaseMixin, unittest.TestCase): def test_file_post_data(self): - filecontent = "fooaowpeufbarasjhf" + filecontent = b"fooaowpeufbarasjhf" testfile = tempfile.NamedTemporaryFile() testfile.write(filecontent) testfile.flush() @@ -482,7 +482,7 @@ class RequestsTestSuite(TestSetup, TestBaseMixin, unittest.TestCase): rbody = json.loads(r.text) assert rbody.get('form') in (None, {}) - self.assertEqual(rbody.get('data'), filecontent) + self.assertEqual(rbody.get('data'), filecontent.decode('ascii')) def test_urlencoded_post_querystring(self): -- 2.7.4