Skip to content

Commit

Permalink
ECOM-3673 Update the course end date description text to remove the r…
Browse files Browse the repository at this point in the history
…eference to certificate when course enrollment is in audit mode
  • Loading branch information
schenedx authored and Renzo Lucioni committed Apr 5, 2016
1 parent 69305ce commit 649e8b1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lms/djangoapps/courseware/date_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,11 @@ def is_enabled(self):
@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
Expand Down
10 changes: 9 additions & 1 deletion lms/djangoapps/courseware/tests/test_date_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,22 @@ def test_start_date_render(self):

## 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(
block.description,
'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)
Expand Down

0 comments on commit 649e8b1

Please sign in to comment.