[py3k] unicode → six.text_type
authorRémi Cardona <remi.cardona@logilab.fr>
Fri, 18 Sep 2015 11:58:29 +0200
changeset 10707 3f4f190f8e35
parent 10706 b261d90149d0
child 10708 d5e3fffa9c07
[py3k] unicode → six.text_type
test/unittest_entity.py
--- a/test/unittest_entity.py	Fri Sep 18 11:54:12 2015 +0200
+++ b/test/unittest_entity.py	Fri Sep 18 11:58:29 2015 +0200
@@ -20,6 +20,8 @@
 
 from datetime import datetime
 
+from six import text_type
+
 from logilab.common import tempattr
 from logilab.common.decorators import clear_cache
 
@@ -771,11 +773,11 @@
             # ambiguity test
             person2 = req.create_entity('Personne', prenom=u'remi', nom=u'doe')
             person.cw_clear_all_caches()
-            self.assertEqual(person.rest_path(), unicode(person.eid))
-            self.assertEqual(person2.rest_path(), unicode(person2.eid))
+            self.assertEqual(person.rest_path(), text_type(person.eid))
+            self.assertEqual(person2.rest_path(), text_type(person2.eid))
             # unique attr with None value (nom in this case)
             friend = req.create_entity('Ami', prenom=u'bob')
-            self.assertEqual(friend.rest_path(), unicode(friend.eid))
+            self.assertEqual(friend.rest_path(), text_type(friend.eid))
             # 'ref' below is created without the unique but not required
             # attribute, make sur that the unique _and_ required 'ean' is used
             # as the rest attribute