From 537d422942b53bc0a2b6a51968f379c0de07793c Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Sat, 18 Apr 2020 11:48:30 -0700 Subject: [PATCH] Simplified LongNameTest.test_sequence_name_length_limits_flush() with execute_sql_flush(). --- tests/backends/tests.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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):