diff --git a/tests/backends/tests.py b/tests/backends/tests.py index 2cbfa2f5a2..d6c2331378 100644 --- a/tests/backends/tests.py +++ b/tests/backends/tests.py @@ -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):