Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions lms/djangoapps/certificates/tests/test_webview_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down
4 changes: 3 additions & 1 deletion lms/templates/certificates/_about-edx.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ <h2 class="about-edx-title hd-4">${company_about_title}</h2>
<div class="about-edx-copy copy copy-meta">
<p>${company_about_description}</p>

<a class="action" href="${company_about_url}">${company_about_urltext}</a>
% if company_about_url is not UNDEFINED:
<a class="action" href="${company_about_url}">${company_about_urltext}</a>
% endif
</div>
</section>
Loading