  from ..utils import postgis
  from .models import City
  
  
  class SchemaIndexesTests(TestCase):
      @skipUnless(postgis, 'This is a PostGIS-specific test.')
      def test_using_sql(self):
          index = Index(fields=['point'])
          editor = connection.schema_editor()
          self.assertIn(
 
</s> remove from ..utils import postgis
 </s> add from ..utils import mysql, oracle, postgis </s> remove from django.test import TestCase
 </s> add from django.test import TransactionTestCase </s> remove             name=self.quote_name('%s_%s_id' % (model._meta.db_table, field.column)),
 </s> add             name=self.quote_name(index_name),
class SchemaIndexesTests(TransactionTestCase):
    available_apps = []
    models = [City]

    def get_indexes(self, table):
        with connection.cursor() as cursor:
            constraints = connection.introspection.get_constraints(cursor, table)
            return {
                name: constraint['columns']
                for name, constraint in constraints.items()
                if constraint['index']
            }

    def has_spatial_indexes(self, table):
        if mysql:
            with connection.cursor() as cursor:
                return connection.introspection.supports_spatial_index(cursor, table)
        elif oracle:
            # Spatial indexes in Meta.indexes are not supported by the Oracle
            # backend (see #31252).
            return False
        return True

  from ..utils import postgis
  from .models import City
  
  
class SchemaIndexesTests(TransactionTestCase):
    available_apps = []
    models = [City]

    def get_indexes(self, table):
        with connection.cursor() as cursor:
            constraints = connection.introspection.get_constraints(cursor, table)
            return {
                name: constraint['columns']
                for name, constraint in constraints.items()
                if constraint['index']
            }

    def has_spatial_indexes(self, table):
        if mysql:
            with connection.cursor() as cursor:
                return connection.introspection.supports_spatial_index(cursor, table)
        elif oracle:
            # Spatial indexes in Meta.indexes are not supported by the Oracle
            # backend (see #31252).
            return False
        return True

      @skipUnless(postgis, 'This is a PostGIS-specific test.')
      def test_using_sql(self):
          index = Index(fields=['point'])
          editor = connection.schema_editor()
          self.assertIn(
keep keep keep keep replace keep keep keep keep keep
 Fixed #30846 -- Made PostGIS backend respect Index's name argument. 
tests/gis_tests/geoapp/test_indexes.py