Python 3 compatibility

This commit is contained in:
Itai Shirav 2018-06-10 16:17:35 +03:00
parent 658d1da5ce
commit 86f05a0c23
2 changed files with 2 additions and 1 deletions

View File

@ -37,6 +37,7 @@ class ServerError(DatabaseException):
else:
# just skip custom init
# if non-standard message format
self.message = message
super(ServerError, self).__init__(message)
ERROR_PATTERN = re.compile(r'''

View File

@ -162,7 +162,7 @@ class DatabaseTestCase(TestCaseWithData):
float_field = Float32Field()
with self.assertRaises(DatabaseException) as cm:
self.database.create_table(EnginelessModel)
self.assertEqual(cm.exception.message, 'EnginelessModel class must define an engine')
self.assertEqual(str(cm.exception), 'EnginelessModel class must define an engine')
def test_potentially_problematic_field_names(self):
class Model1(Model):