[py3k] unicode → six.text_type
authorRémi Cardona <remi.cardona@logilab.fr>
Mon, 21 Sep 2015 18:35:38 +0200
changeset 10724 aa3eedba866c
parent 10723 c5bedfdd1b22
child 10725 1776c94a74e8
[py3k] unicode → six.text_type
hooks/test/unittest_hooks.py
hooks/test/unittest_syncsession.py
--- a/hooks/test/unittest_hooks.py	Mon Sep 21 18:28:10 2015 +0200
+++ b/hooks/test/unittest_hooks.py	Mon Sep 21 18:35:38 2015 +0200
@@ -24,9 +24,12 @@
 
 from datetime import datetime
 
+from six import text_type
+
 from cubicweb import ValidationError, AuthenticationError, BadConnectionId
 from cubicweb.devtools.testlib import CubicWebTC
 
+
 class CoreHooksTC(CubicWebTC):
 
     def test_inlined(self):
@@ -207,7 +210,7 @@
             with self.assertRaises(ValidationError) as cm:
                 cnx.execute('INSERT CWUser X: X login "admin"')
             ex = cm.exception
-            ex.translate(unicode)
+            ex.translate(text_type)
             self.assertIsInstance(ex.entity, int)
             self.assertEqual(ex.errors, {'login-subject': 'the value "admin" is already used, use another one'})
 
--- a/hooks/test/unittest_syncsession.py	Mon Sep 21 18:28:10 2015 +0200
+++ b/hooks/test/unittest_syncsession.py	Mon Sep 21 18:35:38 2015 +0200
@@ -22,6 +22,8 @@
   syncschema.py hooks are mostly tested in server/test/unittest_migrations.py
 """
 
+from six import text_type
+
 from cubicweb import ValidationError
 from cubicweb.devtools.testlib import CubicWebTC
 
@@ -32,13 +34,13 @@
             with self.assertRaises(ValidationError) as cm:
                 req.execute('INSERT CWProperty X: X pkey "bla.bla", '
                             'X value "hop", X for_user U')
-            cm.exception.translate(unicode)
+            cm.exception.translate(text_type)
             self.assertEqual(cm.exception.errors,
                              {'pkey-subject': 'unknown property key bla.bla'})
 
             with self.assertRaises(ValidationError) as cm:
                 req.execute('INSERT CWProperty X: X pkey "bla.bla", X value "hop"')
-            cm.exception.translate(unicode)
+            cm.exception.translate(text_type)
             self.assertEqual(cm.exception.errors,
                              {'pkey-subject': 'unknown property key bla.bla'})