Simplified LongNameTest.test_sequence_name_length_limits_flush() with execute_sql_flush().
@@ -162,9 +162,7 @@ class LongNameTest(TransactionTestCase):
VLM_m2m._meta.db_table,
]
sql_list = connection.ops.sql_flush(no_style(), tables, reset_sequences=True)
- with connection.cursor() as cursor:
- for statement in sql_list:
- cursor.execute(statement)
+ connection.ops.execute_sql_flush(connection.alias, sql_list)
class SequenceResetTest(TestCase):
