(self)
| 338 | ) |
| 339 | |
| 340 | def test_gin_parameters(self): |
| 341 | index_name = "integer_array_gin_params" |
| 342 | index = GinIndex( |
| 343 | fields=["field"], |
| 344 | name=index_name, |
| 345 | fastupdate=True, |
| 346 | gin_pending_list_limit=64, |
| 347 | db_tablespace="pg_default", |
| 348 | ) |
| 349 | with connection.schema_editor() as editor: |
| 350 | editor.add_index(IntegerArrayModel, index) |
| 351 | self.assertIn( |
| 352 | ") WITH (gin_pending_list_limit = 64, fastupdate = on) TABLESPACE", |
| 353 | str(index.create_sql(IntegerArrayModel, editor)), |
| 354 | ) |
| 355 | constraints = self.get_constraints(IntegerArrayModel._meta.db_table) |
| 356 | self.assertEqual(constraints[index_name]["type"], "gin") |
| 357 | self.assertEqual( |
| 358 | constraints[index_name]["options"], |
| 359 | ["gin_pending_list_limit=64", "fastupdate=on"], |
| 360 | ) |
| 361 | with connection.schema_editor() as editor: |
| 362 | editor.remove_index(IntegerArrayModel, index) |
| 363 | self.assertNotIn( |
| 364 | index_name, self.get_constraints(IntegerArrayModel._meta.db_table) |
| 365 | ) |
| 366 | |
| 367 | def test_trigram_op_class_gin_index(self): |
| 368 | index_name = "trigram_op_class_gin" |
nothing calls this directly
no test coverage detected