Commit d0b2787f by Sanford Student

TNL-1230: cert available date hidden in self paced

parent 3131790a
......@@ -214,7 +214,7 @@ CMS.URL.UPLOAD_ASSET = '${upload_asset_url | n, js_escaped_string}'
</li>
</ol>
% if waffle.waffle().is_enabled(waffle.INSTRUCTOR_PACED_ONLY):
% if waffle.waffle().is_enabled(waffle.INSTRUCTOR_PACED_ONLY) and not context_course.self_paced:
<ol class="list-input">
<li class="field-group field-group-certificate-available" id="certificate-available">
<div class="field date" id="field-certificate-available-date">
......
......@@ -205,8 +205,9 @@ class CertificateAvailableDate(DateSummary):
@property
def is_enabled(self):
return self.date is not None and datetime.datetime.now(utc) <= self.date and waffle.waffle().is_enabled(
waffle.INSTRUCTOR_PACED_ONLY
return (
self.date is not None and datetime.datetime.now(utc) <= self.date and not self.course.self_paced and
waffle.waffle().is_enabled(waffle.INSTRUCTOR_PACED_ONLY)
)
@property
......
......@@ -362,6 +362,18 @@ class CourseDateSummaryTest(SharedModuleStoreTestCase):
self.assertEqual(block.date, None)
self.assertFalse(block.is_enabled)
## CertificateAvailableDate
@waffle.testutils.override_switch('certificates.instructor_paced_only', True)
def test_no_certificate_available_date_for_self_paced(self):
course = self.create_self_paced_course_run()
verified_user = self.create_user()
CourseEnrollmentFactory(course_id=course.id, user=verified_user, mode=CourseMode.VERIFIED)
course.certificate_available_date = datetime.now(utc) + timedelta(days=7)
course.save()
block = CertificateAvailableDate(course, verified_user)
self.assertNotEqual(block.date, None)
self.assertFalse(block.is_enabled)
@waffle.testutils.override_switch('certificates.instructor_paced_only', True)
def test_certificate_available_date_defined(self):
course = self.create_course_run()
......
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