Merge pull request #2375 from edx/adam/lms2118-bulk-email-unicode-errors
Adam/lms2118 bulk email unicode errors
This commit is contained in:
@@ -374,7 +374,7 @@ def _get_source_address(course_id, course_title):
|
||||
invalid_chars = re.compile(r"[^\w.-]")
|
||||
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
|
||||
|
||||
|
||||
@@ -677,5 +677,5 @@ def _statsd_tag(course_title):
|
||||
"""
|
||||
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]
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Unit tests for student optouts from course email
|
||||
"""
|
||||
@@ -26,7 +27,8 @@ class TestOptoutCourseEmails(ModuleStoreTestCase):
|
||||
"""
|
||||
|
||||
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.student = UserFactory.create()
|
||||
CourseEnrollmentFactory.create(user=self.student, course_id=self.course.id)
|
||||
|
||||
@@ -48,7 +48,8 @@ class TestEmailSendFromDashboard(ModuleStoreTestCase):
|
||||
|
||||
@patch.dict(settings.FEATURES, {'ENABLE_INSTRUCTOR_EMAIL': True, 'REQUIRE_COURSE_EMAIL_AUTH': False})
|
||||
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)
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Unit tests for handling email sending errors
|
||||
"""
|
||||
@@ -43,7 +44,8 @@ class TestEmailErrors(ModuleStoreTestCase):
|
||||
"""
|
||||
|
||||
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.client.login(username=self.instructor.username, password="test")
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Unit tests for bulk-email-related forms.
|
||||
"""
|
||||
@@ -23,8 +24,8 @@ class CourseAuthorizationFormTest(ModuleStoreTestCase):
|
||||
"""Test the CourseAuthorizationAdminForm form for Mongo-backed courses."""
|
||||
|
||||
def setUp(self):
|
||||
# Make a mongo course
|
||||
self.course = CourseFactory.create()
|
||||
course_title = u"ẗëṡẗ title イ乇丂イ ᄊ乇丂丂ムg乇 キo尺 ムレレ тэѕт мэѕѕаБэ"
|
||||
self.course = CourseFactory.create(display_name=course_title)
|
||||
|
||||
def tearDown(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user