(self, index)
| 3415 | editor.alter_unique_together(Book, [["author", "title"]], []) |
| 3416 | |
| 3417 | def _test_composed_index_with_fk(self, index): |
| 3418 | with connection.schema_editor() as editor: |
| 3419 | editor.create_model(Author) |
| 3420 | editor.create_model(Book) |
| 3421 | table = Book._meta.db_table |
| 3422 | self.assertEqual(Book._meta.indexes, []) |
| 3423 | Book._meta.indexes = [index] |
| 3424 | with connection.schema_editor() as editor: |
| 3425 | editor.add_index(Book, index) |
| 3426 | self.assertIn(index.name, self.get_constraints(table)) |
| 3427 | Book._meta.indexes = [] |
| 3428 | with connection.schema_editor() as editor: |
| 3429 | editor.remove_index(Book, index) |
| 3430 | self.assertNotIn(index.name, self.get_constraints(table)) |
| 3431 | |
| 3432 | def test_composed_index_with_fk(self): |
| 3433 | index = Index(fields=["author", "title"], name="book_author_title_idx") |
no test coverage detected