From 28b26ee9463aaa9b43c773f04a20a5d781718dea Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 3 Jun 2020 13:57:56 -0400 Subject: [PATCH] Set create_constraint=True for boolean constraint test SQLAlchemy will be defaulting create_constraint to False in an upcoming major release [1]. As this test relies upon the CHECK constraint being present, set create_constraint to True. [1] https://github.com/sqlalchemy/sqlalchemy/issues/5367 Change-Id: Ie822172ef797dc1bf8050d9b5cabe6782120ea45 --- oslo_db/tests/sqlalchemy/test_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oslo_db/tests/sqlalchemy/test_utils.py b/oslo_db/tests/sqlalchemy/test_utils.py index e6174a79..50f4af11 100644 --- a/oslo_db/tests/sqlalchemy/test_utils.py +++ b/oslo_db/tests/sqlalchemy/test_utils.py @@ -905,7 +905,7 @@ class TestMigrationUtils(db_test_base._DbTestCase): table_name = 'abc' table = Table(table_name, self.meta, Column('id', Integer, primary_key=True), - Column('deleted', Boolean)) + Column('deleted', Boolean(create_constraint=True))) ck = [ const for const in table.constraints if isinstance(const, CheckConstraint)][0]