MCPcopy
hub / github.com/django/django / test_ops_class

Method test_ops_class

tests/indexes/tests.py:177–189  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

175 self.assertEqual(len(index_sql), 1)
176
177 def test_ops_class(self):
178 index = Index(
179 name="test_ops_class",
180 fields=["headline"],
181 opclasses=["varchar_pattern_ops"],
182 )
183 with connection.schema_editor() as editor:
184 editor.add_index(IndexedArticle2, index)
185 with editor.connection.cursor() as cursor:
186 cursor.execute(self.get_opclass_query % "test_ops_class")
187 self.assertEqual(
188 cursor.fetchall(), [("varchar_pattern_ops", "test_ops_class")]
189 )
190
191 def test_ops_class_multiple_columns(self):
192 index = Index(

Callers

nothing calls this directly

Calls 5

IndexClass · 0.90
schema_editorMethod · 0.80
cursorMethod · 0.80
add_indexMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected