Commit 58ff601c authored by Michal Čihař's avatar Michal Čihař

Need to open files as binary

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 075fb3ba
...@@ -60,7 +60,7 @@ class ImportBaseTest(ViewTestCase): ...@@ -60,7 +60,7 @@ class ImportBaseTest(ViewTestCase):
if test_file is None: if test_file is None:
test_file = self.test_file test_file = self.test_file
with open(test_file) as handle: with open(test_file, 'rb') as handle:
params = {'file': handle} params = {'file': handle}
params.update(kwargs) params.update(kwargs)
return self.client.post( return self.client.post(
...@@ -311,7 +311,7 @@ class AndroidImportTest(ViewTestCase): ...@@ -311,7 +311,7 @@ class AndroidImportTest(ViewTestCase):
return self.create_android() return self.create_android()
def test_import(self): def test_import(self):
with open(TEST_ANDROID) as handle: with open(TEST_ANDROID, 'rb') as handle:
self.client.post( self.client.post(
reverse( reverse(
'upload_translation', 'upload_translation',
...@@ -331,7 +331,7 @@ class CSVImportTest(ViewTestCase): ...@@ -331,7 +331,7 @@ class CSVImportTest(ViewTestCase):
translation = self.get_translation() translation = self.get_translation()
self.assertEqual(translation.translated, 0) self.assertEqual(translation.translated, 0)
self.assertEqual(translation.fuzzy, 0) self.assertEqual(translation.fuzzy, 0)
with open(TEST_CSV) as handle: with open(TEST_CSV, 'rb') as handle:
self.client.post( self.client.post(
reverse( reverse(
'upload_translation', 'upload_translation',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment