Change asserts with more specific assert methods.

This patch replaces assertTrue(isinstance(a, b))
by native assert function assertIsInstance/assertNotIsInstance.

Change-Id: Ia3e34167a1c454fde1b28079c1742b99e1d40ff1
This commit is contained in:
Luong Anh Tuan 2016-08-31 18:43:24 +07:00 committed by Tuan Luong-Anh
parent d5066073a7
commit 375661ee23
1 changed files with 3 additions and 4 deletions

View File

@ -265,10 +265,9 @@ class MigrationCheckersMixin(object):
self.assertIsInstance(rules.c.description.type, sqlalchemy.types.Text)
self.assertIn('disabled', col_names)
# in some backends bool type is integer
self.assertTrue(isinstance(rules.c.disabled.type,
sqlalchemy.types.Boolean) or
isinstance(rules.c.disabled.type,
sqlalchemy.types.Integer))
self.assertIsInstance(rules.c.disabled.type,
(sqlalchemy.types.Boolean,
sqlalchemy.types.Integer))
conditions = db_utils.get_table(engine, 'rule_conditions')
col_names = [column.name for column in conditions.c]