Commit 1bcc2308 by Chris Dodge

make sure the unicode method actually supports unicode characters

parent f86653e5
...@@ -58,7 +58,7 @@ class ProctoredExam(TimeStampedModel): ...@@ -58,7 +58,7 @@ class ProctoredExam(TimeStampedModel):
How to serialize myself as a string How to serialize myself as a string
""" """
return "{course_id}: {exam_name} ({active})".format( return u"{course_id}: {exam_name} ({active})".format(
course_id=self.course_id, course_id=self.course_id,
exam_name=self.exam_name, exam_name=self.exam_name,
active='active' if self.is_active else 'inactive', active='active' if self.is_active else 'inactive',
......
# coding=utf-8
# pylint: disable=invalid-name
""" """
All tests for the models.py All tests for the models.py
""" """
# pylint: disable=invalid-name
from edx_proctoring.models import ( from edx_proctoring.models import (
ProctoredExam, ProctoredExam,
ProctoredExamStudentAllowance, ProctoredExamStudentAllowance,
...@@ -29,6 +30,20 @@ class ProctoredExamModelTests(LoggedInTestCase): ...@@ -29,6 +30,20 @@ class ProctoredExamModelTests(LoggedInTestCase):
""" """
super(ProctoredExamModelTests, self).setUp() super(ProctoredExamModelTests, self).setUp()
def test_unicode(self):
"""
Make sure we support Unicode characters
"""
proctored_exam = ProctoredExam.objects.create(
course_id='test_course',
content_id='test_content',
exam_name=u'अआईउऊऋऌ अआईउऊऋऌ',
external_id='123aXqe3',
time_limit_mins=90
)
output = unicode(proctored_exam)
self.assertEquals(output, u"test_course: अआईउऊऋऌ अआईउऊऋऌ (inactive)")
def test_save_proctored_exam_student_allowance_history(self): # pylint: disable=invalid-name def test_save_proctored_exam_student_allowance_history(self): # pylint: disable=invalid-name
""" """
Test to Save and update the proctored Exam Student Allowance object. Test to Save and update the proctored Exam Student Allowance object.
......
...@@ -34,7 +34,7 @@ def load_requirements(*requirements_paths): ...@@ -34,7 +34,7 @@ def load_requirements(*requirements_paths):
setup( setup(
name='edx-proctoring', name='edx-proctoring',
version='0.10.16', version='0.10.17',
description='Proctoring subsystem for Open edX', description='Proctoring subsystem for Open edX',
long_description=open('README.md').read(), long_description=open('README.md').read(),
author='edX', author='edX',
......
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