@@ -209,17 +209,37 @@ class TestInstructorEnrollsStudent(ModuleStoreTestCase, LoginEnrollmentTestCase)
...
@@ -209,17 +209,37 @@ class TestInstructorEnrollsStudent(ModuleStoreTestCase, LoginEnrollmentTestCase)
# Check the outbox
# Check the outbox
self.assertEqual(len(mail.outbox),3)
self.assertEqual(len(mail.outbox),3)
self.assertEqual(mail.outbox[0].subject,'You have been enrolled in MITx/999/Robot_Super_Course')
self.assertEqual(
self.assertEqual(mail.outbox[0].body,"Dear Jim Tester\n\nYou have been enrolled in MITx/999/Robot_Super_Course at edx.org by a member of the course staff. "+
mail.outbox[0].subject,
"The course should now appear on your edx.org dashboard.\n\n"+
"----\nThis email was automatically sent from edx.org to Jim Tester")
self.assertEqual(
mail.outbox[0].body,
self.assertEqual(mail.outbox[1].subject,'You have been invited to register for MITx/999/Robot_Super_Course')
"Dear Robot Test\n\nYou have been enrolled in Robot Super Course "
self.assertEqual(mail.outbox[1].body,"Dear student,\n\nYou have been invited to join MITx/999/Robot_Super_Course at edx.org by a member of the course staff.\n\n"+
"at edx.org by a member of the course staff. "
"To finish your registration, please visit https://edx.org/register and fill out the registration form making sure to use student3_1@test.com in the E-mail field.\n"+
"The course should now appear on your edx.org dashboard.\n\n"
"Once you have registered and activated your account, you will see MITx/999/Robot_Super_Course listed on your dashboard.\n\n"+
"----\nThis email was automatically sent from edx.org to Robot Test"
)
self.assertEqual(
mail.outbox[1].subject,
'You have been invited to register for Robot Super Course'
)
self.assertEqual(
mail.outbox[1].body,
"Dear student,\n\nYou have been invited to join "
"Robot Super Course at edx.org by a member of the "
"course staff.\n\n"
"To finish your registration, please visit "
"https://edx.org/register and fill out the registration form "
"making sure to use student3_1@test.com in the E-mail field.\n"
"Once you have registered and activated your account, you will "
"see Robot Super Course listed on your dashboard.\n\n"
"----\nThis email was automatically sent from edx.org to "
"student3_1@test.com"
)
deftest_unenrollment_email_on(self):
deftest_unenrollment_email_on(self):
"""
"""
...
@@ -242,11 +262,23 @@ class TestInstructorEnrollsStudent(ModuleStoreTestCase, LoginEnrollmentTestCase)
...
@@ -242,11 +262,23 @@ class TestInstructorEnrollsStudent(ModuleStoreTestCase, LoginEnrollmentTestCase)
# Check the outbox
# Check the outbox
self.assertEqual(len(mail.outbox),3)
self.assertEqual(len(mail.outbox),3)
self.assertEqual(mail.outbox[0].subject,'You have been un-enrolled from MITx/999/Robot_Super_Course')
self.assertEqual(
self.assertEqual(mail.outbox[0].body,"Dear Student,\n\nYou have been un-enrolled from course MITx/999/Robot_Super_Course by a member of the course staff. "+
mail.outbox[0].subject,
"Please disregard the invitation previously sent.\n\n"+
'You have been un-enrolled from Robot Super Course'
"----\nThis email was automatically sent from edx.org to student4_0@test.com")
)
self.assertEqual(mail.outbox[1].subject,'You have been un-enrolled from MITx/999/Robot_Super_Course')
self.assertEqual(
mail.outbox[0].body,
"Dear Student,\n\nYou have been un-enrolled from course "
"Robot Super Course by a member of the course staff. "
"Please disregard the invitation previously sent.\n\n"
"----\nThis email was automatically sent from edx.org "
"to student4_0@test.com"
)
self.assertEqual(
mail.outbox[1].subject,
'You have been un-enrolled from Robot Super Course'
<%! from django.utils.translation import ugettext as _ %>
You have been invited to join ${course_id} at ${site_name} by a member of the course staff.
${_("Dear student,")}
To finish your registration, please visit ${registration_url} and fill out the registration form making sure to use ${email_address} in the E-mail field.
${_("You have been invited to join {course_name} at {site_name} by a "
"member of the course staff.").format(
course_name=course.display_name_with_default,
site_name=site_name
)}
${_("To finish your registration, please visit {registration_url} and fill "
"out the registration form making sure to use {email_address} in the "
"E-mail field.").format(
registration_url=registration_url,
email_address=email_address
)}
% if auto_enroll:
% if auto_enroll:
Once you have registered and activated your account, you will see ${course_id} listed on your dashboard.
${_("Once you have registered and activated your account, you will see "
"{course_name} listed on your dashboard.").format(
course_name=course.display_name_with_default
)}
% else:
% else:
Once you have registered and activated your account, visit ${course_url} to join the course.
${_("Once you have registered and activated your account, visit {course_url} "
"to join the course.").format(course_url=course_url)}
% endif
% endif
----
----
This email was automatically sent from ${site_name} to ${email_address}
${_("This email was automatically sent from {site_name} to "
<%! from django.utils.translation import ugettext as _ %>
You have been un-enrolled in ${course_id} at ${site_name} by a member of the course staff. The course will no longer appear on your ${site_name} dashboard.