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
d408f174
Commit
d408f174
authored
Apr 18, 2014
by
Sarina Canelake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wording for batch beta email add with autoenroll (LMS-2551)
parent
19b6718c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
2 deletions
+48
-2
lms/djangoapps/instructor/tests/test_api.py
+42
-0
lms/djangoapps/instructor/views/api.py
+1
-1
lms/templates/emails/add_beta_tester_email_message.txt
+5
-1
No files found.
lms/djangoapps/instructor/tests/test_api.py
View file @
d408f174
...
...
@@ -845,6 +845,48 @@ class TestInstructorAPIBulkBetaEnrollment(ModuleStoreTestCase, LoginEnrollmentTe
)
)
def
test_add_notenrolled_with_email_autoenroll
(
self
):
url
=
reverse
(
'bulk_beta_modify_access'
,
kwargs
=
{
'course_id'
:
self
.
course
.
id
})
response
=
self
.
client
.
get
(
url
,
{
'identifiers'
:
self
.
notenrolled_student
.
email
,
'action'
:
'add'
,
'email_students'
:
True
,
'auto_enroll'
:
True
}
)
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertTrue
(
CourseBetaTesterRole
(
self
.
course
.
location
)
.
has_user
(
self
.
notenrolled_student
))
# test the response data
expected
=
{
"action"
:
"add"
,
"results"
:
[
{
"identifier"
:
self
.
notenrolled_student
.
email
,
"error"
:
False
,
"userDoesNotExist"
:
False
}
]
}
res_json
=
json
.
loads
(
response
.
content
)
self
.
assertEqual
(
res_json
,
expected
)
# Check the outbox
self
.
assertEqual
(
len
(
mail
.
outbox
),
1
)
self
.
assertEqual
(
mail
.
outbox
[
0
]
.
subject
,
'You have been invited to a beta test for Robot Super Course'
)
self
.
assertEqual
(
mail
.
outbox
[
0
]
.
body
,
u"Dear {0}
\n\n
You have been invited to be a beta tester "
"for Robot Super Course at edx.org by a member of the course staff.
\n\n
"
"To start accessing course materials, please visit "
"https://edx.org/courses/MITx/999/Robot_Super_Course/
\n\n
----
\n
"
"This email was automatically sent from edx.org to {1}"
.
format
(
self
.
notenrolled_student
.
profile
.
name
,
self
.
notenrolled_student
.
email
)
)
def
test_add_notenrolled_email_mktgsite
(
self
):
url
=
reverse
(
'bulk_beta_modify_access'
,
kwargs
=
{
'course_id'
:
self
.
course
.
id
})
# Try with marketing site enabled
...
...
lms/djangoapps/instructor/views/api.py
View file @
d408f174
...
...
@@ -342,7 +342,7 @@ def bulk_beta_modify_access(request, course_id):
email_params
=
{}
if
email_students
:
email_params
=
get_email_params
(
course
,
auto_enroll
=
False
)
email_params
=
get_email_params
(
course
,
auto_enroll
=
auto_enroll
)
for
identifier
in
identifiers
:
try
:
...
...
lms/templates/emails/add_beta_tester_email_message.txt
View file @
d408f174
...
...
@@ -8,7 +8,11 @@ ${_("You have been invited to be a beta tester for {course_name} at {site_name}
site_name=site_name
)}
% if course_about_url is not None:
% if auto_enroll:
${_("To start accessing course materials, please visit {course_url}").format(
course_url=course_url
)}
% elif course_about_url is not None:
${_("Visit {course_about_url} to join the course and begin the beta test.").format(course_about_url=course_about_url)}
% else:
${_("Visit {site_name} to enroll in the course and begin the beta test.").format(site_name=site_name)}
...
...
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