Commit 33fc268d by Simon Chen

ECOM-3673 Update the course end date description text to remove the reference to…

ECOM-3673 Update the course end date description text to remove the reference to certificate when course enrollment is in audit mode
parent 7b549bc3
......@@ -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
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment