fix SQL comparison test for SQLAlchemy 2.0.38
SQLAlchemy 2.0.38 made a change to the compiled SQL format of an IN expression that includes NULL. Update a single IN related SQL compilation test in test_utils to be more agnostic about the format of this IN expression Change-Id: I0f72fc70967db9f5582f7b4e31ecf741eb54134e
This commit is contained in:
parent
76352bda80
commit
87e686ff36
@ -1016,10 +1016,13 @@ class TestModelQuery(test_base.BaseTestCase):
|
||||
MyModelSoftDeletedProjectId,
|
||||
session=self.session, project_id=(10, None))
|
||||
|
||||
self.assertEqual(
|
||||
self.assertRegex(
|
||||
str(
|
||||
mock_query.filter.call_args[0][0].
|
||||
compile(compile_kwargs={"render_postcompile": True})
|
||||
),
|
||||
'soft_deleted_project_id_test_model.project_id'
|
||||
' IN (:project_id_1, NULL)',
|
||||
str(mock_query.filter.call_args[0][0])
|
||||
r' IN \(:project_id.+, (?::project_id.+|NULL)\)',
|
||||
)
|
||||
|
||||
def test_model_query_common(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user