Custom 500 error message should only be seen for Preview
This commit is contained in:
@@ -454,9 +454,13 @@ class CertificatesViewsTests(ModuleStoreTestCase, EventTrackingTestCase):
|
||||
user_id=self.user.id,
|
||||
course_id=unicode(self.course.id)
|
||||
)
|
||||
response = self.client.get(test_url)
|
||||
response = self.client.get(test_url + "?preview=honor")
|
||||
self.assertIn("Invalid Certificate Configuration", response.content)
|
||||
|
||||
# Verify that Exception is raised when certificate is not in the preview mode
|
||||
with self.assertRaises(Exception):
|
||||
self.client.get(test_url)
|
||||
|
||||
@override_settings(FEATURES=FEATURES_WITH_CERTS_ENABLED)
|
||||
def test_certificate_evidence_event_emitted(self):
|
||||
self.client.logout()
|
||||
|
||||
@@ -281,7 +281,10 @@ def _update_certificate_context(context, course, user, user_certificate):
|
||||
)
|
||||
|
||||
|
||||
@handle_500(template_path="certificates/server-error.html")
|
||||
@handle_500(
|
||||
template_path="certificates/server-error.html",
|
||||
test_func=lambda request: request.GET.get('preview', None)
|
||||
)
|
||||
def render_html_view(request, user_id, course_id):
|
||||
"""
|
||||
This public view generates an HTML representation of the specified student's certificate
|
||||
|
||||
Reference in New Issue
Block a user