Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
7e075eec
Commit
7e075eec
authored
Feb 03, 2014
by
Jay Zoldak
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2433 from edx/zoldak/fix-tests-unicode
Mark strings that were causing test failures as unicode
parents
f48a456b
5ab0c9ad
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
lms/djangoapps/bulk_email/forms.py
+1
-1
lms/djangoapps/bulk_email/tests/test_forms.py
+3
-3
No files found.
lms/djangoapps/bulk_email/forms.py
View file @
7e075eec
...
@@ -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
)
...
...
lms/djangoapps/bulk_email/tests/test_forms.py
View file @
7e075eec
...
@@ -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."
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment