Temporary fix for unicode literal breaking test.

This commit is contained in:
Cory Benfield
2012-06-19 18:09:22 +01:00
parent bcf04d5e93
commit f8076fee5e
+8 -1
View File
@@ -351,7 +351,14 @@ class RequestsTestSuite(TestSetup, TestBaseMixin, unittest.TestCase):
post5 = post(url, files={'file': ('file.txt', 'more fdata')})
self.assertEqual(post5.status_code, 200)
post6 = post(url, files={'fname.txt': '\xe9'})
# Dirty hack to tide us over until 3.3.
# TODO: Remove this hack when Python 3.3 is released.
if (sys.version_info[0] == 2):
fdata = '\xc3\xa9'.decode('utf-8')
else:
fdata = '\xe9'
post6 = post(url, files={'fname.txt': fdata})
self.assertEqual(post6.status_code, 200)
post7 = post(url, files={'fname.txt': 'fdata to verify'})