python 3 fixes

fixed test failures

fixed test failures

python 3 fixes

fixed test failures

fixed test failures

changes made as suggested

minor change
This commit is contained in:
aarif
2019-09-03 14:18:33 +05:00
parent 898eba600f
commit ec894ee10c
2 changed files with 2 additions and 2 deletions

View File

@@ -168,7 +168,7 @@ class UniversalNewlineIterator(object):
line = char
yield self.sanitize(last_line)
else:
line += char
line += six.text_type(char) if isinstance(char, int) else char
buf = self.original_file.read(self.buffer_size)
if not buf and line:
yield self.sanitize(line)

View File

@@ -5255,7 +5255,7 @@ class TestBulkCohorting(SharedModuleStoreTestCase):
# this temporary file will be removed in `self.tearDown()`
__, file_name = tempfile.mkstemp(suffix=suffix, dir=self.tempdir)
with open(file_name, 'w') as file_pointer:
file_pointer.write(csv_data.encode('utf-8'))
file_pointer.write(csv_data)
with open(file_name, 'r') as file_pointer:
url = reverse('add_users_to_cohorts', kwargs={'course_id': text_type(self.course.id)})
return self.client.post(url, {'uploaded-file': file_pointer})