diff options
| author | Tim Graham <timograham@gmail.com> | 2014-06-24 06:43:10 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-06-24 06:43:40 -0400 |
| commit | 088b30f49b0f5e14fc6876eb424af340d5479dac (patch) | |
| tree | c285c149902856f400a02705cdca9aefa9f9a77d | |
| parent | 198ce3073c763ab17cb5e8d012d64d8ea756282d (diff) | |
[1.7.x] refs #22487: Don't flush out data from before normal TestCases (spatialite)
| -rw-r--r-- | django/contrib/gis/db/backends/spatialite/creation.py | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/django/contrib/gis/db/backends/spatialite/creation.py b/django/contrib/gis/db/backends/spatialite/creation.py index a2ebb125ee..a3d4de9369 100644 --- a/django/contrib/gis/db/backends/spatialite/creation.py +++ b/django/contrib/gis/db/backends/spatialite/creation.py @@ -41,7 +41,8 @@ class SpatiaLiteCreation(DatabaseCreation): verbosity=max(verbosity - 1, 0), interactive=False, database=self.connection.alias, - load_initial_data=False) + load_initial_data=False, + test_flush=True) # We then serialize the current state of the database into a string # and store it on the connection. This slightly horrific process is so people @@ -50,16 +51,6 @@ class SpatiaLiteCreation(DatabaseCreation): if serialize: self.connection._test_serialized_contents = self.serialize_db_to_string() - # We need to then do a flush to ensure that any data installed by - # custom SQL has been removed. The only test data should come from - # test fixtures, or autogenerated from post_migrate triggers. - # This has the side effect of loading initial data (which was - # intentionally skipped in the migrate). - call_command('flush', - verbosity=max(verbosity - 1, 0), - interactive=False, - database=self.connection.alias) - call_command('createcachetable', database=self.connection.alias) # Ensure a connection for the side effect of initializing the test database. |
