diff --git a/lms/djangoapps/instructor/tests/test_api.py b/lms/djangoapps/instructor/tests/test_api.py index e623632bb6..0724566661 100644 --- a/lms/djangoapps/instructor/tests/test_api.py +++ b/lms/djangoapps/instructor/tests/test_api.py @@ -4764,7 +4764,7 @@ class TestCourseIssuedCertificatesData(SharedModuleStoreTestCase): self.assertEqual(response['Content-Type'], 'text/csv') self.assertEqual(response['Content-Disposition'], u'attachment; filename={0}'.format('issued_certificates.csv')) self.assertEqual( - response.content.strip(), + response.content.strip().decode('utf-8'), '"CourseID","Certificate Type","Total Certificates Issued","Date Report Run"\r\n"' + str(self.course.id) + '","honor","3","' + current_date + '"' ) diff --git a/lms/djangoapps/instructor_analytics/csvs.py b/lms/djangoapps/instructor_analytics/csvs.py index a5ca1c5f6e..67700a8ddb 100644 --- a/lms/djangoapps/instructor_analytics/csvs.py +++ b/lms/djangoapps/instructor_analytics/csvs.py @@ -32,11 +32,11 @@ def create_csv_response(filename, header, datarows): quotechar='"', quoting=csv.QUOTE_ALL) - encoded_header = [six.text_type(s).encode('utf-8') for s in header] + encoded_header = [six.text_type(s) for s in header] csvwriter.writerow(encoded_header) for datarow in datarows: - encoded_row = [six.text_type(s).encode('utf-8') for s in datarow] + encoded_row = [six.text_type(s) for s in datarow] csvwriter.writerow(encoded_row) return response