[server/test] unicode → six.text_type
authorJulien Cristau <julien.cristau@logilab.fr>
Tue, 13 Oct 2015 11:30:48 +0200
changeset 10788 416840faf119
parent 10787 34ada3b21eef
child 10789 d5671a61f281
[server/test] unicode → six.text_type
server/test/unittest_undo.py
--- a/server/test/unittest_undo.py	Mon Oct 12 21:49:18 2015 +0200
+++ b/server/test/unittest_undo.py	Tue Oct 13 11:30:48 2015 +0200
@@ -17,6 +17,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 text_type
+
 from cubicweb import ValidationError
 from cubicweb.devtools.testlib import CubicWebTC
 import cubicweb.server.session
@@ -255,7 +257,7 @@
                 "%s doesn't exist anymore." % g.eid])
             with self.assertRaises(ValidationError) as cm:
                 cnx.commit()
-            cm.exception.translate(unicode)
+            cm.exception.translate(text_type)
             self.assertEqual(cm.exception.entity, self.totoeid)
             self.assertEqual(cm.exception.errors,
                               {'in_group-subject': u'at least one relation in_group is '
@@ -461,7 +463,7 @@
     # problem occurs in string manipulation for python < 2.6
     def test___unicode__method(self):
         u = _UndoException(u"voilà")
-        self.assertIsInstance(unicode(u), unicode)
+        self.assertIsInstance(text_type(u), text_type)
 
 
 if __name__ == '__main__':