Skip to content
Snippets Groups Projects
Unverified Commit e0a22db8 authored by Jeremy Bowman's avatar Jeremy Bowman Committed by GitHub
Browse files

Fix Python 3 bug in LTI stub server BOM-1006 (#22260)

parent 92345251
Branches
Tags release-2020-08-26-16.45
No related merge requests found
...@@ -267,7 +267,7 @@ class StubLtiHandler(StubHttpRequestHandler): ...@@ -267,7 +267,7 @@ class StubLtiHandler(StubHttpRequestHandler):
# Calculate and encode body hash. See http://oauth.googlecode.com/svn/spec/ext/body_hash/1.0/oauth-bodyhash.html # Calculate and encode body hash. See http://oauth.googlecode.com/svn/spec/ext/body_hash/1.0/oauth-bodyhash.html
sha1 = hashlib.sha1() sha1 = hashlib.sha1()
sha1.update(body.encode('utf-8')) sha1.update(body.encode('utf-8'))
oauth_body_hash = six.text_type(base64.b64encode(sha1.digest())) oauth_body_hash = base64.b64encode(sha1.digest()).decode('utf-8')
mock_request = mock.Mock( mock_request = mock.Mock(
uri=six.text_type(six.moves.urllib.parse.unquote(url)), uri=six.text_type(six.moves.urllib.parse.unquote(url)),
headers=headers, headers=headers,
......
...@@ -19,7 +19,7 @@ from ...pages.lms.courseware import CoursewarePage, LTIContentIframe ...@@ -19,7 +19,7 @@ from ...pages.lms.courseware import CoursewarePage, LTIContentIframe
from ..helpers import UniqueCourseTest, auto_auth, select_option_by_text from ..helpers import UniqueCourseTest, auto_auth, select_option_by_text
class TestLTIConusmer(UniqueCourseTest): class TestLTIConsumer(UniqueCourseTest):
""" """
Base class for tests of LTI xblock in the LMS. Base class for tests of LTI xblock in the LMS.
""" """
...@@ -29,7 +29,7 @@ class TestLTIConusmer(UniqueCourseTest): ...@@ -29,7 +29,7 @@ class TestLTIConusmer(UniqueCourseTest):
host = os.environ.get('BOK_CHOY_HOSTNAME', '127.0.0.1') host = os.environ.get('BOK_CHOY_HOSTNAME', '127.0.0.1')
def setUp(self): def setUp(self):
super(TestLTIConusmer, self).setUp() super(TestLTIConsumer, self).setUp()
self.courseware_page = CoursewarePage(self.browser, self.course_id) self.courseware_page = CoursewarePage(self.browser, self.course_id)
self.lti_iframe = LTIContentIframe(self.browser, self.course_id) self.lti_iframe = LTIContentIframe(self.browser, self.course_id)
self.tab_nav = TabNavPage(self.browser) self.tab_nav = TabNavPage(self.browser)
......
...@@ -139,6 +139,9 @@ def recalculate_course_and_subsection_grades_for_user(self, **kwargs): # pylint ...@@ -139,6 +139,9 @@ def recalculate_course_and_subsection_grades_for_user(self, **kwargs): # pylint
Recalculates the course grade and all subsection grades Recalculates the course grade and all subsection grades
for the given ``user`` and ``course_key`` keyword arguments. for the given ``user`` and ``course_key`` keyword arguments.
""" """
if 'lms.djangoapps.grades.apps.GradesConfig' not in settings.INSTALLED_APPS:
# This task errors when run in-process during Studio tests, just skip it
return
user_id = kwargs.get('user_id') user_id = kwargs.get('user_id')
course_key_str = kwargs.get('course_key') course_key_str = kwargs.get('course_key')
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment