[PATCH 6 of 8 cwclientlib] [py3] json.loads() only accept string

Philippe Pepiot philippe.pepiot at logilab.fr
Tue Jun 12 08:36:05 CEST 2018


# HG changeset patch
# User Philippe Pepiot <philippe.pepiot at logilab.fr>
# Date 1528785114 -7200
#      Tue Jun 12 08:31:54 2018 +0200
# Node ID c2bce4828b10ad5692eb5fb1343aa09684052d37
# Parent  c1be21dc784721f57721df60821672df79fe1f24
# Available At https://hg.logilab.org/review/cwclientlib
#              hg pull https://hg.logilab.org/review/cwclientlib -r c2bce4828b10
[py3] json.loads() only accept string

diff --git a/cwclientlib/test/test_cwproxy.py b/cwclientlib/test/test_cwproxy.py
--- a/cwclientlib/test/test_cwproxy.py
+++ b/cwclientlib/test/test_cwproxy.py
@@ -224,7 +224,7 @@ class CWProxyClientTC(CubicWebWsgiTC):
         content_type = headers['Content-Type']
         self.assertEqual(content_type, 'application/json')
         body = request.body
-        self.assertEqual(json.loads(body), data)
+        self.assertEqual(json.loads(body.decode('utf-8')), data)
 
 
 class UtilsTests(unittest.TestCase):


More information about the cubicweb-devel mailing list