python 3 compatibility

This commit is contained in:
Itai Shirav 2017-04-28 18:18:23 +03:00
parent 10cc021acf
commit 64bf3b423e
2 changed files with 2 additions and 2 deletions

View File

@ -121,7 +121,7 @@ class QuerySetTestCase(TestCaseWithData):
self._test_qs(qs.filter(num__gt=1), 3)
self._test_qs(qs.filter(num__gte=1), 4)
self._test_qs(qs.filter(num__in=(1, 2, 3)), 3)
self._test_qs(qs.filter(num__in=xrange(1, 4)), 3)
self._test_qs(qs.filter(num__in=range(1, 4)), 3)
Color = Enum('Color', u'red blue green yellow brown white black')

View File

@ -24,7 +24,7 @@ class ReadonlyTestCase(TestCaseWithData):
self.database.drop_table(Person)
with self.assertRaises(DatabaseException):
self.database.drop_database()
except DatabaseException, e:
except DatabaseException as e:
if 'Unknown user' in unicode(e):
raise unittest.SkipTest('Database user "%s" is not defined' % username)
else: