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
4751322f
Commit
4751322f
authored
Jan 30, 2014
by
Adam
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2375 from edx/adam/lms2118-bulk-email-unicode-errors
Adam/lms2118 bulk email unicode errors
parents
5372bcff
ee24e106
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
7 deletions
+13
-7
lms/djangoapps/bulk_email/tasks.py
+2
-2
lms/djangoapps/bulk_email/tests/test_course_optout.py
+3
-1
lms/djangoapps/bulk_email/tests/test_email.py
+2
-1
lms/djangoapps/bulk_email/tests/test_err_handling.py
+3
-1
lms/djangoapps/bulk_email/tests/test_forms.py
+3
-2
No files found.
lms/djangoapps/bulk_email/tasks.py
View file @
4751322f
...
@@ -374,7 +374,7 @@ def _get_source_address(course_id, course_title):
...
@@ -374,7 +374,7 @@ def _get_source_address(course_id, course_title):
invalid_chars
=
re
.
compile
(
r"[^\w.-]"
)
invalid_chars
=
re
.
compile
(
r"[^\w.-]"
)
course_num
=
invalid_chars
.
sub
(
'_'
,
course_num
)
course_num
=
invalid_chars
.
sub
(
'_'
,
course_num
)
from_addr
=
'"{0}" Course Staff <{1}-{2}>'
.
format
(
course_title_no_quotes
,
course_num
,
settings
.
BULK_EMAIL_DEFAULT_FROM_EMAIL
)
from_addr
=
u
'"{0}" Course Staff <{1}-{2}>'
.
format
(
course_title_no_quotes
,
course_num
,
settings
.
BULK_EMAIL_DEFAULT_FROM_EMAIL
)
return
from_addr
return
from_addr
...
@@ -677,5 +677,5 @@ def _statsd_tag(course_title):
...
@@ -677,5 +677,5 @@ def _statsd_tag(course_title):
"""
"""
Calculate the tag we will use for DataDog.
Calculate the tag we will use for DataDog.
"""
"""
tag
=
"course_email:{0}"
.
format
(
course_title
)
tag
=
u
"course_email:{0}"
.
format
(
course_title
)
return
tag
[:
200
]
return
tag
[:
200
]
lms/djangoapps/bulk_email/tests/test_course_optout.py
View file @
4751322f
# -*- coding: utf-8 -*-
"""
"""
Unit tests for student optouts from course email
Unit tests for student optouts from course email
"""
"""
...
@@ -26,7 +27,8 @@ class TestOptoutCourseEmails(ModuleStoreTestCase):
...
@@ -26,7 +27,8 @@ class TestOptoutCourseEmails(ModuleStoreTestCase):
"""
"""
def
setUp
(
self
):
def
setUp
(
self
):
self
.
course
=
CourseFactory
.
create
()
course_title
=
u"ẗëṡẗ title イ乇丂イ ᄊ乇丂丂ムg乇 キo尺 ムレレ тэѕт мэѕѕаБэ"
self
.
course
=
CourseFactory
.
create
(
display_name
=
course_title
)
self
.
instructor
=
AdminFactory
.
create
()
self
.
instructor
=
AdminFactory
.
create
()
self
.
student
=
UserFactory
.
create
()
self
.
student
=
UserFactory
.
create
()
CourseEnrollmentFactory
.
create
(
user
=
self
.
student
,
course_id
=
self
.
course
.
id
)
CourseEnrollmentFactory
.
create
(
user
=
self
.
student
,
course_id
=
self
.
course
.
id
)
...
...
lms/djangoapps/bulk_email/tests/test_email.py
View file @
4751322f
...
@@ -48,7 +48,8 @@ class TestEmailSendFromDashboard(ModuleStoreTestCase):
...
@@ -48,7 +48,8 @@ class TestEmailSendFromDashboard(ModuleStoreTestCase):
@patch.dict
(
settings
.
FEATURES
,
{
'ENABLE_INSTRUCTOR_EMAIL'
:
True
,
'REQUIRE_COURSE_EMAIL_AUTH'
:
False
})
@patch.dict
(
settings
.
FEATURES
,
{
'ENABLE_INSTRUCTOR_EMAIL'
:
True
,
'REQUIRE_COURSE_EMAIL_AUTH'
:
False
})
def
setUp
(
self
):
def
setUp
(
self
):
self
.
course
=
CourseFactory
.
create
()
course_title
=
u"ẗëṡẗ title イ乇丂イ ᄊ乇丂丂ムg乇 キo尺 ムレレ тэѕт мэѕѕаБэ"
self
.
course
=
CourseFactory
.
create
(
display_name
=
course_title
)
self
.
instructor
=
InstructorFactory
(
course
=
self
.
course
.
location
)
self
.
instructor
=
InstructorFactory
(
course
=
self
.
course
.
location
)
...
...
lms/djangoapps/bulk_email/tests/test_err_handling.py
View file @
4751322f
# -*- coding: utf-8 -*-
"""
"""
Unit tests for handling email sending errors
Unit tests for handling email sending errors
"""
"""
...
@@ -43,7 +44,8 @@ class TestEmailErrors(ModuleStoreTestCase):
...
@@ -43,7 +44,8 @@ class TestEmailErrors(ModuleStoreTestCase):
"""
"""
def
setUp
(
self
):
def
setUp
(
self
):
self
.
course
=
CourseFactory
.
create
()
course_title
=
u"ẗëṡẗ title イ乇丂イ ᄊ乇丂丂ムg乇 キo尺 ムレレ тэѕт мэѕѕаБэ"
self
.
course
=
CourseFactory
.
create
(
display_name
=
course_title
)
self
.
instructor
=
AdminFactory
.
create
()
self
.
instructor
=
AdminFactory
.
create
()
self
.
client
.
login
(
username
=
self
.
instructor
.
username
,
password
=
"test"
)
self
.
client
.
login
(
username
=
self
.
instructor
.
username
,
password
=
"test"
)
...
...
lms/djangoapps/bulk_email/tests/test_forms.py
View file @
4751322f
# -*- coding: utf-8 -*-
"""
"""
Unit tests for bulk-email-related forms.
Unit tests for bulk-email-related forms.
"""
"""
...
@@ -23,8 +24,8 @@ class CourseAuthorizationFormTest(ModuleStoreTestCase):
...
@@ -23,8 +24,8 @@ class CourseAuthorizationFormTest(ModuleStoreTestCase):
"""Test the CourseAuthorizationAdminForm form for Mongo-backed courses."""
"""Test the CourseAuthorizationAdminForm form for Mongo-backed courses."""
def
setUp
(
self
):
def
setUp
(
self
):
# Make a mongo course
course_title
=
u"ẗëṡẗ title イ乇丂イ ᄊ乇丂丂ムg乇 キo尺 ムレレ тэѕт мэѕѕаБэ"
self
.
course
=
CourseFactory
.
create
()
self
.
course
=
CourseFactory
.
create
(
display_name
=
course_title
)
def
tearDown
(
self
):
def
tearDown
(
self
):
"""
"""
...
...
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