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:
Feanil Patel
2019-09-12 12:21:07 -04:00
parent f8129721d9
commit a3d39eaeb6

View File

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