MCPcopy
hub / github.com/django/django / test_deconstruction

Method test_deconstruction

tests/model_indexes/tests.py:212–225  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

210 self.assertEqual(index.name, "t_quoted_name_e4ed1b_idx")
211
212 def test_deconstruction(self):
213 index = models.Index(fields=["title"], db_tablespace="idx_tbls")
214 index.set_name_with_model(Book)
215 path, args, kwargs = index.deconstruct()
216 self.assertEqual(path, "django.db.models.Index")
217 self.assertEqual(args, ())
218 self.assertEqual(
219 kwargs,
220 {
221 "fields": ["title"],
222 "name": "model_index_title_196f42_idx",
223 "db_tablespace": "idx_tbls",
224 },
225 )
226
227 def test_deconstruct_with_condition(self):
228 index = models.Index(

Callers

nothing calls this directly

Calls 2

set_name_with_modelMethod · 0.95
deconstructMethod · 0.95

Tested by

no test coverage detected