[ext/test] fix test relying on repr(text)
authorJulien Cristau <julien.cristau@logilab.fr>
Thu, 01 Oct 2015 12:02:02 +0200
changeset 10754 03aa9f2a4ecb
parent 10753 c90e7bf2dd55
child 10755 4c48d3bab38c
[ext/test] fix test relying on repr(text)
ext/test/unittest_rest.py
--- a/ext/test/unittest_rest.py	Thu Oct 01 12:01:28 2015 +0200
+++ b/ext/test/unittest_rest.py	Thu Oct 01 12:02:02 2015 +0200
@@ -15,6 +15,8 @@
 #
 # You should have received a copy of the GNU Lesser General Public License along
 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
+from six import PY3
+
 from logilab.common.testlib import unittest_main
 from cubicweb.devtools.testlib import CubicWebTC
 
@@ -79,7 +81,9 @@
             context = self.context(req)
             out = rest_publish(context, ':rql:`Any X WHERE X is CWUser:toto`')
             self.assertTrue(out.startswith("<p>an error occurred while interpreting this "
-                                           "rql directive: ObjectNotFound(u'toto',)</p>"))
+                                           "rql directive: ObjectNotFound(%s'toto',)</p>" %
+                                           ('' if PY3 else 'u')),
+                            out)
 
     def test_rql_role_without_vid(self):
         with self.admin_access.web_request() as req: