[test] restore support for python < 2.6
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 21 Oct 2011 14:32:18 +0200
changeset 7989 db76e8aaec29
parent 7988 d72a2881d53c
child 7990 a673d1d9a738
[test] restore support for python < 2.6
web/test/unittest_views_json.py
--- a/web/test/unittest_views_json.py	Fri Oct 21 13:05:45 2011 +0200
+++ b/web/test/unittest_views_json.py	Fri Oct 21 14:32:18 2011 +0200
@@ -1,6 +1,6 @@
 from cubicweb.devtools.testlib import CubicWebTC
 
-from json import loads
+from cubicweb.utils import json
 
 class JsonViewsTC(CubicWebTC):
 
@@ -35,7 +35,7 @@
     def test_json_ersetexport(self):
         req = self.request()
         rset = req.execute('Any G ORDERBY GN WHERE G is CWGroup, G name GN')
-        data = loads(self.view('ejsonexport', rset))
+        data = json.loads(self.view('ejsonexport', rset))
         self.assertEqual(req.headers_out.getRawHeaders('content-type'), ['application/json'])
         self.assertEqual(data[0]['name'], 'guests')
         self.assertEqual(data[1]['name'], 'managers')