MCPcopy
hub / github.com/django/django / _fixture_teardown

Method _fixture_teardown

django/test/testcases.py:1265–1286  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1263 )
1264
1265 def _fixture_teardown(self):
1266 # Allow TRUNCATE ... CASCADE and don't emit the post_migrate signal
1267 # when flushing only a subset of the apps
1268 for db_name in self._databases_names(include_mirrors=False):
1269 # Flush the database
1270 inhibit_post_migrate = (
1271 self.available_apps is not None
1272 or ( # Inhibit the post_migrate signal when using serialized
1273 # rollback to avoid trying to recreate the serialized data.
1274 self.serialized_rollback
1275 and hasattr(connections[db_name], "_test_serialized_contents")
1276 )
1277 )
1278 call_command(
1279 "flush",
1280 verbosity=0,
1281 interactive=False,
1282 database=db_name,
1283 reset_sequences=False,
1284 allow_cascade=self.available_apps is not None,
1285 inhibit_post_migrate=inhibit_post_migrate,
1286 )
1287
1288 def assertQuerySetEqual(self, qs, values, transform=None, ordered=True, msg=None):
1289 values = list(values)

Callers 1

_post_teardownMethod · 0.95

Calls 2

_databases_namesMethod · 0.95
call_commandFunction · 0.90

Tested by

no test coverage detected