[1.7.x] Improved GIS migration test cleanup; refs #23504.

Backport of 8facb02faf from master
This commit is contained in:
Tim Graham 2014-09-17 19:45:42 -04:00
parent 07b4c3e115
commit c61d2c0387
1 changed files with 2 additions and 2 deletions

View File

@ -67,6 +67,7 @@ class OperationTests(TransactionTestCase):
operation.state_forwards("gis", new_state) operation.state_forwards("gis", new_state)
with connection.schema_editor() as editor: with connection.schema_editor() as editor:
operation.database_forwards("gis", editor, project_state, new_state) operation.database_forwards("gis", editor, project_state, new_state)
self.current_state = new_state
self.assertColumnExists("gis_neighborhood", "path") self.assertColumnExists("gis_neighborhood", "path")
# Test GeometryColumns when available # Test GeometryColumns when available
@ -75,7 +76,6 @@ class OperationTests(TransactionTestCase):
GeometryColumns.objects.filter(**{GeometryColumns.table_name_col(): "gis_neighborhood"}).count(), GeometryColumns.objects.filter(**{GeometryColumns.table_name_col(): "gis_neighborhood"}).count(),
2 2
) )
self.current_state = new_state
def test_remove_gis_field(self): def test_remove_gis_field(self):
""" """
@ -87,6 +87,7 @@ class OperationTests(TransactionTestCase):
operation.state_forwards("gis", new_state) operation.state_forwards("gis", new_state)
with connection.schema_editor() as editor: with connection.schema_editor() as editor:
operation.database_forwards("gis", editor, project_state, new_state) operation.database_forwards("gis", editor, project_state, new_state)
self.current_state = new_state
self.assertColumnNotExists("gis_neighborhood", "geom") self.assertColumnNotExists("gis_neighborhood", "geom")
# Test GeometryColumns when available # Test GeometryColumns when available
@ -95,4 +96,3 @@ class OperationTests(TransactionTestCase):
GeometryColumns.objects.filter(**{GeometryColumns.table_name_col(): "gis_neighborhood"}).count(), GeometryColumns.objects.filter(**{GeometryColumns.table_name_col(): "gis_neighborhood"}).count(),
0 0
) )
self.current_state = new_state