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
dd20badc
Commit
dd20badc
authored
May 15, 2015
by
Shrhawk
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7996 from edx/shr/bug/TNL-2119-Unicode-error-in-templating-bulk-course
bulk_email fix course_image_unicode name
parents
e7a348d6
f199c305
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletions
+17
-1
lms/djangoapps/bulk_email/tasks.py
+2
-1
lms/djangoapps/bulk_email/tests/test_tasks.py
+15
-0
No files found.
lms/djangoapps/bulk_email/tasks.py
View file @
dd20badc
# -*- coding: utf-8 -*-
"""
This module contains celery task functions for handling the sending of bulk email
to a course.
...
...
@@ -152,7 +153,7 @@ def _get_course_email_context(course):
settings
.
SITE_NAME
,
reverse
(
'course_root'
,
kwargs
=
{
'course_id'
:
course_id
})
)
image_url
=
'https://{}{}'
.
format
(
settings
.
SITE_NAME
,
course_image_url
(
course
))
image_url
=
u
'https://{}{}'
.
format
(
settings
.
SITE_NAME
,
course_image_url
(
course
))
email_context
=
{
'course_title'
:
course_title
,
'course_url'
:
course_url
,
...
...
lms/djangoapps/bulk_email/tests/test_tasks.py
View file @
dd20badc
# -*- coding: utf-8 -*-
"""
Unit tests for LMS instructor-initiated background tasks.
...
...
@@ -29,6 +30,8 @@ from celery.states import SUCCESS, FAILURE
from
django.conf
import
settings
from
django.core.management
import
call_command
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
bulk_email.models
import
CourseEmail
,
Optout
,
SEND_TO_ALL
from
instructor_task.tasks
import
send_bulk_course_email
...
...
@@ -404,3 +407,15 @@ class TestBulkEmailInstructorTask(InstructorTaskCourseTestCase):
def
test_failure_on_ses_domain_not_confirmed
(
self
):
self
.
_test_immediate_failure
(
SESDomainNotConfirmedError
(
403
,
"You're out of bounds!"
))
def
test_bulk_emails_with_unicode_course_image_name
(
self
):
# Test bulk email with unicode characters in course image name
course_image
=
u'在淡水測試.jpg'
self
.
course
=
CourseFactory
.
create
(
course_image
=
course_image
)
num_emails
=
1
self
.
_create_students
(
num_emails
)
with
patch
(
'bulk_email.tasks.get_connection'
,
autospec
=
True
)
as
get_conn
:
get_conn
.
return_value
.
send_messages
.
side_effect
=
cycle
([
None
])
self
.
_test_run_with_task
(
send_bulk_course_email
,
'emailed'
,
num_emails
,
num_emails
)
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