Skip to content

Commit

Permalink
make sure the unicode method actually supports unicode characters
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Dodge committed Nov 6, 2015
1 parent f86653e commit 1bcc230
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion edx_proctoring/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def __unicode__(self):
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,
exam_name=self.exam_name,
active='active' if self.is_active else 'inactive',
Expand Down
17 changes: 16 additions & 1 deletion edx_proctoring/tests/test_models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# coding=utf-8
# pylint: disable=invalid-name
"""
All tests for the models.py
"""
# pylint: disable=invalid-name
from edx_proctoring.models import (
ProctoredExam,
ProctoredExamStudentAllowance,
Expand Down Expand Up @@ -29,6 +30,20 @@ def setUp(self):
"""
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
"""
Test to Save and update the proctored Exam Student Allowance object.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def load_requirements(*requirements_paths):

setup(
name='edx-proctoring',
version='0.10.16',
version='0.10.17',
description='Proctoring subsystem for Open edX',
long_description=open('README.md').read(),
author='edX',
Expand Down

0 comments on commit 1bcc230

Please sign in to comment.