  from unittest import skipUnless
  
  from django.db import connection
  from django.db.models import Index
  from django.test import TestCase
  
  from ..utils import postgis
  from .models import City
  
  
 
</s> remove from ..utils import postgis
 </s> add from ..utils import mysql, oracle, postgis </s> remove class SchemaIndexesTests(TestCase):
 </s> add 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
 </s> remove             name=self.quote_name('%s_%s_id' % (model._meta.db_table, field.column)),
 </s> add             name=self.quote_name(index_name),
from django.test import TransactionTestCase
  from unittest import skipUnless
  
  from django.db import connection
  from django.db.models import Index
from django.test import TransactionTestCase
  
  from ..utils import postgis
  from .models import City
  
  
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