Commit 31b2be17 by Matt Drayer

Merge pull request #9010 from edx/ziafazal/SOL-1045-hide-generate-certs-button

SOL-1045: hiding generated certificate button in case of self paced courses
parents a347db40 5925edbf
......@@ -111,6 +111,23 @@ class CertificatesInstructorDashTest(ModuleStoreTestCase):
self.assertContains(response, 'enable-certificates-submit')
self.assertNotContains(response, 'Generate Example Certificates')
@mock.patch.dict(settings.FEATURES, {'CERTIFICATES_HTML_VIEW': True})
def test_buttons_for_html_certs_in_self_paced_course(self):
"""
Tests `Enable Student-Generated Certificates` button is enabled
and `Generate Certificates` button is not available if
course has Web/HTML certificates view enabled on a self paced course.
"""
self.course.cert_html_view_enabled = True
self.course.save()
self.store.update_item(self.course, self.global_staff.id) # pylint: disable=no-member
self.client.login(username=self.global_staff.username, password="test")
response = self.client.get(self.url)
self.assertContains(response, 'Enable Student-Generated Certificates')
self.assertContains(response, 'enable-certificates-submit')
self.assertNotContains(response, 'Generate Certificates')
self.assertNotContains(response, 'btn-start-generating-certificates')
def _assert_certificates_visible(self, is_visible):
"""Check that the certificates section is visible on the instructor dash. """
response = self.client.get(self.url)
......
......@@ -58,7 +58,7 @@
% endif
</div>
% if section_data['instructor_generation_enabled']:
% if section_data['instructor_generation_enabled'] and not (section_data['enabled_for_course'] and section_data['html_cert_enabled']):
<hr />
<div class="start-certificate-generation">
......
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