BOM-114
python2 tests failures.
This commit is contained in:
@@ -520,7 +520,7 @@ def generate_random_string(length):
|
||||
if char not in 'aAeEiIoOuU1l'
|
||||
]
|
||||
|
||||
return string.join((random.choice(chars) for __ in range(length)), '')
|
||||
return ''.join((random.choice(chars) for i in range(length)))
|
||||
|
||||
|
||||
def generate_unique_password(generated_passwords, password_length=12):
|
||||
|
||||
@@ -321,5 +321,5 @@ class DjangoStorageReportStore(ReportStore):
|
||||
"""
|
||||
Return the full path to a given file for a given course.
|
||||
"""
|
||||
hashed_course_id = hashlib.sha1(text_type(course_id)).hexdigest()
|
||||
hashed_course_id = hashlib.sha1(text_type(course_id).encode('utf-8')).hexdigest()
|
||||
return os.path.join(hashed_course_id, filename)
|
||||
|
||||
@@ -1367,7 +1367,7 @@ class TestExecutiveSummaryReport(TestReportMixin, InstructorTaskCourseTestCase):
|
||||
report_html_filename = report_store.links_for(self.course.id)[0][0]
|
||||
report_path = report_store.path_to(self.course.id, report_html_filename)
|
||||
with report_store.storage.open(report_path) as html_file:
|
||||
html_file_data = html_file.read()
|
||||
html_file_data = html_file.read().decode('utf-8')
|
||||
for data in expected_data:
|
||||
self.assertIn(data, html_file_data)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user