Skip to content
Snippets Groups Projects
Commit 79869165 authored by Awais Qureshi's avatar Awais Qureshi
Browse files

BOM-137

python3 tests failures.
parent 07a683a8
No related branches found
No related tags found
No related merge requests found
......@@ -32,7 +32,9 @@ def course_slug(course_key, mode):
Badgr's max slug length is 255.
"""
# Seven digits should be enough to realistically avoid collisions. That's what git services use.
digest = hashlib.sha256(u"{}{}".format(six.text_type(course_key), six.text_type(mode))).hexdigest()[:7]
digest = hashlib.sha256(
u"{}{}".format(six.text_type(course_key), six.text_type(mode)).encode('utf-8')
).hexdigest()[:7]
base_slug = slugify(six.text_type(course_key) + u'_{}_'.format(mode))[:248]
return base_slug + digest
......
......@@ -289,9 +289,13 @@ class CertificatesViewsSiteTests(ModuleStoreTestCase):
)
self._add_course_certificates(count=1, signatory_count=2)
response = self.client.get(test_url)
self.assertIn('awarded this My Platform Site Honor Code Certificate of Completion', response.content)
self.assertIn('My Platform Site offers interactive online classes and MOOCs.', response.content)
self.assertIn('About My Platform Site', response.content)
self.assertIn(
'awarded this My Platform Site Honor Code Certificate of Completion', response.content.decode('utf-8')
)
self.assertIn(
'My Platform Site offers interactive online classes and MOOCs.', response.content.decode('utf-8')
)
self.assertIn('About My Platform Site', response.content.decode('utf-8'))
@override_settings(FEATURES=FEATURES_WITH_CERTS_ENABLED)
def test_html_view_site_configuration_missing(self):
......@@ -301,6 +305,8 @@ class CertificatesViewsSiteTests(ModuleStoreTestCase):
)
self._add_course_certificates(count=1, signatory_count=2)
response = self.client.get(test_url)
self.assertIn('edX', response.content)
self.assertNotIn('My Platform Site', response.content)
self.assertNotIn('This should not survive being overwritten by static content', response.content)
self.assertIn('edX', response.content.decode('utf-8'))
self.assertNotIn('My Platform Site', response.content.decode('utf-8'))
self.assertNotIn(
'This should not survive being overwritten by static content', response.content.decode('utf-8')
)
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment