diff --git a/lms/djangoapps/certificates/tests/test_webview_views.py b/lms/djangoapps/certificates/tests/test_webview_views.py index 9817ecd290a3..c3b88bac17bc 100644 --- a/lms/djangoapps/certificates/tests/test_webview_views.py +++ b/lms/djangoapps/certificates/tests/test_webview_views.py @@ -611,6 +611,26 @@ def test_render_html_view_valid_certificate(self): response = self.client.get(test_url) self.assertContains(response, str(self.cert.verify_uuid)) + @override_settings(CERTIFICATES_HTML_VIEW=True) + def test_render_html_view_without_about_url(self): + """ + Tests that the certificate renders when no About page URL is configured + anywhere: not in the HTML view configuration, the site configuration or + the marketing URLs. The "Learn more" link is left out rather than the + template failing on an undefined name. + """ + CertificateHtmlViewConfigurationFactory.create(enabled=False) + self._add_course_certificates(count=1, signatory_count=1) + test_url = get_certificate_url( + user_id=self.user.id, + course_id=str(self.course.id), + uuid=self.cert.verify_uuid + ) + response = self.client.get(test_url) + self.assertContains(response, str(self.cert.verify_uuid)) + self.assertContains(response, 'class="about-item about-edx"') + self.assertNotContains(response, 'Learn more about') + @override_settings(CERTIFICATES_HTML_VIEW=True) def test_render_certificate_only_for_downloadable_status(self): """ diff --git a/lms/templates/certificates/_about-edx.html b/lms/templates/certificates/_about-edx.html index 70b030852519..e25e292d45e0 100644 --- a/lms/templates/certificates/_about-edx.html +++ b/lms/templates/certificates/_about-edx.html @@ -6,6 +6,8 @@