JSON takes unicode as input.
In python2 there would be some auto coercion done so that the orginal code here works but that's not the case in python 3.
This commit is contained in:
@@ -166,10 +166,7 @@ class XBlockContainerFixture(StudioApiFixture):
|
||||
"""
|
||||
Encode `post_dict` (a dictionary) as UTF-8 encoded JSON.
|
||||
"""
|
||||
return json.dumps({
|
||||
k: v.encode('utf-8') if isinstance(v, six.string_types) else v
|
||||
for k, v in post_dict.items()
|
||||
})
|
||||
return json.dumps(post_dict).encode('utf-8')
|
||||
|
||||
def get_nested_xblocks(self, category=None):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user