(self)
| 436 | editor.remove_index(index=index, model=Article) |
| 437 | |
| 438 | def test_boolean_restriction_partial(self): |
| 439 | with connection.schema_editor() as editor: |
| 440 | index = Index( |
| 441 | name="published_index", |
| 442 | fields=["published"], |
| 443 | condition=Q(published=True), |
| 444 | ) |
| 445 | self.assertIn( |
| 446 | "WHERE %s" % editor.quote_name("published"), |
| 447 | str(index.create_sql(Article, schema_editor=editor)), |
| 448 | ) |
| 449 | editor.add_index(index=index, model=Article) |
| 450 | with connection.cursor() as cursor: |
| 451 | self.assertIn( |
| 452 | index.name, |
| 453 | connection.introspection.get_constraints( |
| 454 | cursor=cursor, |
| 455 | table_name=Article._meta.db_table, |
| 456 | ), |
| 457 | ) |
| 458 | editor.remove_index(index=index, model=Article) |
| 459 | |
| 460 | @skipUnlessDBFeature("supports_functions_in_partial_indexes") |
| 461 | def test_multiple_conditions(self): |
nothing calls this directly
no test coverage detected