BOM-618 Don't decode string objects.

This commit is contained in:
Feanil Patel
2019-09-19 14:14:17 -04:00
parent 24c0974f78
commit 9740e2e077
3 changed files with 3 additions and 3 deletions

View File

@@ -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)

View File

@@ -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):