BOM-618 Don't decode string objects.
This commit is contained in:
@@ -657,7 +657,7 @@ oauth_consumer_key="", oauth_signature="frVp4JuvT1mVXlxktiAUjQ7%2F1cw%3D"'}
|
||||
# so '='' becomes '%3D'.
|
||||
# We send form via browser, so browser will encode it again,
|
||||
# So we need to decode signature back:
|
||||
params[u'oauth_signature'] = six.moves.urllib.parse.unquote(params[u'oauth_signature']).decode('utf8')
|
||||
params[u'oauth_signature'] = six.moves.urllib.parse.unquote(params[u'oauth_signature']).encode('utf-8').decode('utf8')
|
||||
|
||||
# Add LTI parameters to OAuth parameters for sending in form.
|
||||
params.update(body)
|
||||
|
||||
@@ -176,7 +176,7 @@ def mock_render_template(*args, **kwargs):
|
||||
Allows us to not depend on any actual template rendering mechanism,
|
||||
while still returning a unicode object
|
||||
"""
|
||||
return pprint.pformat((args, kwargs)).decode()
|
||||
return pprint.pformat((args, kwargs)).encode().decode()
|
||||
|
||||
|
||||
class ModelsTest(unittest.TestCase):
|
||||
|
||||
@@ -88,7 +88,7 @@ class CommandsTestBase(SharedModuleStoreTestCase):
|
||||
|
||||
def test_dump_course_ids(self):
|
||||
output = self.call_command('dump_course_ids')
|
||||
dumped_courses = output.decode('utf-8').strip().split('\n')
|
||||
dumped_courses = output.strip().split('\n')
|
||||
course_ids = {text_type(course_id) for course_id in self.loaded_courses}
|
||||
dumped_ids = set(dumped_courses)
|
||||
self.assertEqual(course_ids, dumped_ids)
|
||||
|
||||
Reference in New Issue
Block a user