(self)
| 414 | editor.remove_index(index=index, model=Article) |
| 415 | |
| 416 | def test_integer_restriction_partial(self): |
| 417 | with connection.schema_editor() as editor: |
| 418 | index = Index( |
| 419 | name="recent_article_idx", |
| 420 | fields=["id"], |
| 421 | condition=Q(pk__gt=1), |
| 422 | ) |
| 423 | self.assertIn( |
| 424 | "WHERE %s" % editor.quote_name("id"), |
| 425 | str(index.create_sql(Article, schema_editor=editor)), |
| 426 | ) |
| 427 | editor.add_index(index=index, model=Article) |
| 428 | with connection.cursor() as cursor: |
| 429 | self.assertIn( |
| 430 | index.name, |
| 431 | connection.introspection.get_constraints( |
| 432 | cursor=cursor, |
| 433 | table_name=Article._meta.db_table, |
| 434 | ), |
| 435 | ) |
| 436 | editor.remove_index(index=index, model=Article) |
| 437 | |
| 438 | def test_boolean_restriction_partial(self): |
| 439 | with connection.schema_editor() as editor: |
nothing calls this directly
no test coverage detected