summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2014-11-28 09:22:03 +0000
committerGerrit Code Review <review@openstack.org>2014-11-28 09:22:03 +0000
commit3d5a9b134f907bc2c4ee65d6d0375927117c2e34 (patch)
tree359c806d40a70f5a270f8cd096460a4678ec2959
parentb80fceaf40aa11553fad2926ef517588b7d0c966 (diff)
parent549ba15e3055d269c6323e6b8b6d072925ad0007 (diff)
downloadoslo-db-3d5a9b134f907bc2c4ee65d6d0375927117c2e34.tar.gz
Merge "Repair include_object to accommodate new objects"
-rw-r--r--tests/sqlalchemy/test_migrations.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/sqlalchemy/test_migrations.py b/tests/sqlalchemy/test_migrations.py
index db6c9c8..1c560e8 100644
--- a/tests/sqlalchemy/test_migrations.py
+++ b/tests/sqlalchemy/test_migrations.py
@@ -240,7 +240,10 @@ class ModelsMigrationSyncMixin(test.BaseTestCase):
self.metadata_migrations.create_all(bind=engine)
def include_object(self, object_, name, type_, reflected, compare_to):
- return type_ == 'table' and name == 'testtbl' or type_ == 'column'
+ if type_ == 'table':
+ return name == 'testtbl'
+ else:
+ return True
def _test_models_not_sync(self):
self.metadata_migrations.clear()
@@ -281,7 +284,7 @@ class ModelsMigrationSyncMixin(test.BaseTestCase):
'Models and migration scripts aren\'t in sync:'))
self.assertIn('testtbl', msg)
self.assertIn('spam', msg)
- self.assertIn('eggs', msg)
+ self.assertIn('eggs', msg) # test that the unique constraint is added
self.assertIn('foo', msg)
self.assertIn('bar', msg)
self.assertIn('bool_wo_default', msg)