From a3d39eaeb6a91dc37c4a5cbc6cd81b8b10c6e0b6 Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Thu, 12 Sep 2019 12:21:07 -0400 Subject: [PATCH] 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. --- common/test/acceptance/fixtures/base.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/common/test/acceptance/fixtures/base.py b/common/test/acceptance/fixtures/base.py index a327a3157c..652ae43573 100644 --- a/common/test/acceptance/fixtures/base.py +++ b/common/test/acceptance/fixtures/base.py @@ -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): """