Commit 5ab0c9ad by Jay Zoldak

Mark strings that were causing test failures as unicode

parent 9c7f84a5
...@@ -64,7 +64,7 @@ class CourseAuthorizationAdminForm(forms.ModelForm): # pylint: disable=R0924 ...@@ -64,7 +64,7 @@ class CourseAuthorizationAdminForm(forms.ModelForm): # pylint: disable=R0924
get_course_by_id(course_id, depth=1) get_course_by_id(course_id, depth=1)
except Exception as exc: except Exception as exc:
msg = 'Error encountered ({0})'.format(str(exc).capitalize()) msg = 'Error encountered ({0})'.format(str(exc).capitalize())
msg += ' --- Entered course id was: "{0}". '.format(course_id) msg += u' --- Entered course id was: "{0}". '.format(course_id)
msg += 'Please recheck that you have supplied a course id in the format: ORG/COURSE/RUN' msg += 'Please recheck that you have supplied a course id in the format: ORG/COURSE/RUN'
raise forms.ValidationError(msg) raise forms.ValidationError(msg)
......
...@@ -84,7 +84,7 @@ class CourseAuthorizationFormTest(ModuleStoreTestCase): ...@@ -84,7 +84,7 @@ class CourseAuthorizationFormTest(ModuleStoreTestCase):
self.assertFalse(form.is_valid()) self.assertFalse(form.is_valid())
msg = u'Error encountered (Course not found.)' msg = u'Error encountered (Course not found.)'
msg += ' --- Entered course id was: "{0}". '.format(bad_id) msg += u' --- Entered course id was: "{0}". '.format(bad_id)
msg += 'Please recheck that you have supplied a course id in the format: ORG/COURSE/RUN' msg += 'Please recheck that you have supplied a course id in the format: ORG/COURSE/RUN'
self.assertEquals(msg, form._errors['course_id'][0]) # pylint: disable=protected-access self.assertEquals(msg, form._errors['course_id'][0]) # pylint: disable=protected-access
...@@ -102,7 +102,7 @@ class CourseAuthorizationFormTest(ModuleStoreTestCase): ...@@ -102,7 +102,7 @@ class CourseAuthorizationFormTest(ModuleStoreTestCase):
self.assertFalse(form.is_valid()) self.assertFalse(form.is_valid())
msg = u'Error encountered (Need more than 1 value to unpack)' msg = u'Error encountered (Need more than 1 value to unpack)'
msg += ' --- Entered course id was: "{0}". '.format(bad_id) msg += u' --- Entered course id was: "{0}". '.format(bad_id)
msg += 'Please recheck that you have supplied a course id in the format: ORG/COURSE/RUN' msg += 'Please recheck that you have supplied a course id in the format: ORG/COURSE/RUN'
self.assertEquals(msg, form._errors['course_id'][0]) # pylint: disable=protected-access self.assertEquals(msg, form._errors['course_id'][0]) # pylint: disable=protected-access
...@@ -126,7 +126,7 @@ class CourseAuthorizationXMLFormTest(ModuleStoreTestCase): ...@@ -126,7 +126,7 @@ class CourseAuthorizationXMLFormTest(ModuleStoreTestCase):
self.assertFalse(form.is_valid()) self.assertFalse(form.is_valid())
msg = u"Course Email feature is only available for courses authored in Studio. " msg = u"Course Email feature is only available for courses authored in Studio. "
msg += '"{0}" appears to be an XML backed course.'.format(course_id) msg += u'"{0}" appears to be an XML backed course.'.format(course_id)
self.assertEquals(msg, form._errors['course_id'][0]) # pylint: disable=protected-access self.assertEquals(msg, form._errors['course_id'][0]) # pylint: disable=protected-access
with self.assertRaisesRegexp(ValueError, "The CourseAuthorization could not be created because the data didn't validate."): with self.assertRaisesRegexp(ValueError, "The CourseAuthorization could not be created because the data didn't validate."):
......
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