|
@@ -940,10 +940,19 @@ class TransactionTestCase(SimpleTestCase):
|
|
|
# when flushing only a subset of the apps
|
|
|
for db_name in self._databases_names(include_mirrors=False):
|
|
|
# Flush the database
|
|
|
+ inhibit_post_migrate = (
|
|
|
+ self.available_apps is not None
|
|
|
+ or (
|
|
|
+ # Inhibit the post_migrate signal when using serialized
|
|
|
+ # rollback to avoid trying to recreate the serialized data.
|
|
|
+ self.serialized_rollback and
|
|
|
+ hasattr(connections[db_name], '_test_serialized_contents')
|
|
|
+ )
|
|
|
+ )
|
|
|
call_command('flush', verbosity=0, interactive=False,
|
|
|
database=db_name, reset_sequences=False,
|
|
|
allow_cascade=self.available_apps is not None,
|
|
|
- inhibit_post_migrate=self.available_apps is not None)
|
|
|
+ inhibit_post_migrate=inhibit_post_migrate)
|
|
|
|
|
|
def assertQuerysetEqual(self, qs, values, transform=repr, ordered=True, msg=None):
|
|
|
items = six.moves.map(transform, qs)
|