Merge pull request #11992 from edx/schen/ECOM-3673

ECOM-3673 Update the course end date description text to remove the reference to certificates
This commit is contained in:
Simon Chen
2016-03-31 11:50:52 -04:00
2 changed files with 14 additions and 2 deletions

View File

@@ -182,7 +182,11 @@ class CourseEndDate(DateSummary):
@property
def description(self):
if datetime.now(pytz.UTC) <= self.date:
return _('To earn a certificate, you must complete all requirements before this date.')
mode, is_active = CourseEnrollment.enrollment_mode_for_user(self.user, self.course.id)
if is_active and CourseMode.is_eligible_for_certificate(mode):
return _('To earn a certificate, you must complete all requirements before this date.')
else:
return _('After this date, course content will be archived.')
return _('This course is archived, which means you can review course content but it is no longer active.')
@property

View File

@@ -173,7 +173,7 @@ class CourseDateSummaryTest(SharedModuleStoreTestCase):
## CourseEndDate
def test_course_end_date_during_course(self):
def test_course_end_date_for_certificate_eligible_mode(self):
self.setup_course_and_user(days_till_start=-1)
block = CourseEndDate(self.course, self.user)
self.assertEqual(
@@ -181,6 +181,14 @@ class CourseDateSummaryTest(SharedModuleStoreTestCase):
'To earn a certificate, you must complete all requirements before this date.'
)
def test_course_end_date_for_non_certificate_eligible_mode(self):
self.setup_course_and_user(days_till_start=-1, enrollment_mode=CourseMode.AUDIT)
block = CourseEndDate(self.course, self.user)
self.assertEqual(
block.description,
'After this date, course content will be archived.'
)
def test_course_end_date_after_course(self):
self.setup_course_and_user(days_till_start=-2, days_till_end=-1)
block = CourseEndDate(self.course, self.user)