@@ -252,7 +252,7 @@ def mock_execute(query, params=None):
252252 return FakeExecResultValidPK ()
253253
254254 # Check for data validation query (id=1 exists)
255- if "WHERE id = 1 " in query .text and "information_schema" not in query .text :
255+ if "WHERE id = :id " in query .text and "information_schema" not in query .text :
256256 return FakeExecResultValidData ()
257257
258258 return FakeExecResult ()
@@ -267,7 +267,7 @@ def mock_execute(query, params=None):
267267 # Verify no migration commands were run
268268 migration_commands = [
269269 "ALTER TABLE persistence ADD COLUMN id INT" ,
270- "UPDATE persistence SET id = 1 " ,
270+ "UPDATE persistence SET id = :id " ,
271271 "DELETE FROM persistence WHERE id IS NULL" ,
272272 ]
273273 for migration_cmd in migration_commands :
@@ -347,11 +347,11 @@ def mock_execute(query, params=None): # pylint: disable=unused-argument
347347 # Verify migration commands were run in correct order
348348 expected_migration_steps = [
349349 "ALTER TABLE persistence ADD COLUMN id INT" ,
350- "UPDATE persistence SET id = 1 " ,
350+ "UPDATE persistence SET id = :id " ,
351351 "DELETE FROM persistence WHERE id IS NULL" ,
352352 "ALTER TABLE persistence ALTER COLUMN id SET NOT NULL" ,
353353 "ALTER TABLE persistence ADD PRIMARY KEY (id)" ,
354- "ALTER TABLE persistence ADD CONSTRAINT single_row CHECK (id = 1 )" ,
354+ "ALTER TABLE persistence ADD CONSTRAINT single_row CHECK (id = :id )" ,
355355 ]
356356
357357 for expected_step in expected_migration_steps :
@@ -500,7 +500,7 @@ def mock_execute(query, params=None): # pylint: disable=unused-argument
500500
501501 # Verify that migration includes step to update first row to id=1
502502 update_first_row = any (
503- "UPDATE persistence SET id = 1 " in query and "LIMIT 1" in query
503+ "UPDATE persistence SET id = :id " in query and "LIMIT 1" in query
504504 for query in executed_queries
505505 )
506506 assert update_first_row
0 commit comments