From 1ff82a57e157a6aebd59c30fc5a65bcedf44ab72 Mon Sep 17 00:00:00 2001 From: Marsel Date: Sun, 14 May 2017 23:11:58 +0300 Subject: [PATCH] Fix "NameError: name 'unicode' is not defined" in python3 --- tests/test_readonly.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_readonly.py b/tests/test_readonly.py index 371fdcb..a192b62 100644 --- a/tests/test_readonly.py +++ b/tests/test_readonly.py @@ -2,6 +2,7 @@ import unittest +import six from infi.clickhouse_orm.database import Database, DatabaseException from infi.clickhouse_orm.models import Model from infi.clickhouse_orm.fields import * @@ -25,7 +26,7 @@ class ReadonlyTestCase(TestCaseWithData): with self.assertRaises(DatabaseException): self.database.drop_database() except DatabaseException as e: - if 'Unknown user' in unicode(e): + if 'Unknown user' in six.text_type(e): raise unittest.SkipTest('Database user "%s" is not defined' % username) else: raise @@ -56,4 +57,3 @@ class ReadOnlyModel(Model): readonly = True name = StringField() -