MCPcopy
hub / github.com/django/django / test_index_name

Method test_index_name

tests/gis_tests/geoapp/test_indexes.py:67–77  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

65 )
66
67 def test_index_name(self):
68 if not self.has_spatial_indexes(City._meta.db_table):
69 self.skipTest("Spatial indexes in Meta.indexes are not supported.")
70 index_name = "custom_point_index_name"
71 index = Index(fields=["point"], name=index_name)
72 with connection.schema_editor() as editor:
73 editor.add_index(City, index)
74 indexes = self.get_indexes(City._meta.db_table)
75 self.assertIn(index_name, indexes)
76 self.assertEqual(indexes[index_name], ["point"])
77 editor.remove_index(City, index)

Callers

nothing calls this directly

Calls 6

has_spatial_indexesMethod · 0.95
get_indexesMethod · 0.95
IndexClass · 0.90
schema_editorMethod · 0.80
add_indexMethod · 0.45
remove_indexMethod · 0.45

Tested by

no test coverage detected