diff --git a/common/djangoapps/student/tests/tests.py b/common/djangoapps/student/tests/tests.py index 0566460dd1..657f072099 100644 --- a/common/djangoapps/student/tests/tests.py +++ b/common/djangoapps/student/tests/tests.py @@ -9,6 +9,7 @@ from datetime import datetime, timedelta from urlparse import urljoin import pytz +from markupsafe import escape from mock import Mock, patch from opaque_keys.edx.locations import SlashSeparatedCourseKey from pyquery import PyQuery as pq @@ -404,7 +405,7 @@ class DashboardTest(ModuleStoreTestCase): self.assertNotIn('Add Certificate to LinkedIn', response.content) response_url = 'http://www.linkedin.com/profile/add?_ed=' - self.assertNotContains(response, response_url) + self.assertNotContains(response, escape(response_url)) @unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms') @patch.dict('django.conf.settings.FEATURES', {'CERTIFICATES_HTML_VIEW': False}) @@ -452,7 +453,7 @@ class DashboardTest(ModuleStoreTestCase): 'pfCertificationUrl=www.edx.org&' 'source=o' ) - self.assertContains(response, expected_url) + self.assertContains(response, escape(expected_url)) @unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms') @ddt.data(ModuleStoreEnum.Type.mongo, ModuleStoreEnum.Type.split) diff --git a/lms/templates/dashboard/_dashboard_certificate_information.html b/lms/templates/dashboard/_dashboard_certificate_information.html index 6145d87794..a07acf823f 100644 --- a/lms/templates/dashboard/_dashboard_certificate_information.html +++ b/lms/templates/dashboard/_dashboard_certificate_information.html @@ -1,5 +1,4 @@ -<%page expression_filter="h"/> -<%page args="cert_status, course_overview, enrollment" /> +<%page expression_filter="h" args="cert_status, course_overview, enrollment" /> <%! from django.utils.translation import ugettext as _ diff --git a/lms/templates/dashboard/_dashboard_xseries_info.html b/lms/templates/dashboard/_dashboard_xseries_info.html index 918f40b118..76fd05715e 100644 --- a/lms/templates/dashboard/_dashboard_xseries_info.html +++ b/lms/templates/dashboard/_dashboard_xseries_info.html @@ -1,5 +1,4 @@ -<%page expression_filter="h"/> -<%page args="program_data, enrollment_mode, display_category" /> +<%page expression_filter="h" args="program_data, enrollment_mode, display_category" /> <%! from django.utils.translation import ugettext as _ from openedx.core.djangolib.markup import Text, HTML