MCPcopy
hub / github.com/django/django / _reset_sequences

Method _reset_sequences

django/test/testcases.py:1198–1208  ·  view source on GitHub ↗
(db_name)

Source from the content-addressed store, hash-verified

1196
1197 @staticmethod
1198 def _reset_sequences(db_name):
1199 conn = connections[db_name]
1200 if conn.features.supports_sequence_reset:
1201 sql_list = conn.ops.sequence_reset_by_name_sql(
1202 no_style(), conn.introspection.sequence_list()
1203 )
1204 if sql_list:
1205 with transaction.atomic(using=db_name):
1206 with conn.cursor() as cursor:
1207 for sql in sql_list:
1208 cursor.execute(sql)
1209
1210 @classmethod
1211 def _fixture_setup(cls):

Callers 1

_fixture_setupMethod · 0.80

Calls 5

no_styleFunction · 0.90
sequence_listMethod · 0.80
cursorMethod · 0.80
executeMethod · 0.45

Tested by

no test coverage detected