summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAkshesh <aksheshdoshi@gmail.com>2016-07-06 22:27:17 +0530
committerTim Graham <timograham@gmail.com>2016-07-07 10:06:55 -0400
commit52442898e747e9d76bf6349938fa3dada6f0e887 (patch)
tree0bafb9ebc1212b4be5ace3449ea01ebd4068b462 /tests
parent34108204603b39b3e4e58cb46012736a4986e6d8 (diff)
Refs #26709 -- Added 'model' argument to SchemaEditor.add/remove_index()
This removes the dependency of the Index class on its model attribute when a name is passed to it. Thanks to Markush for discussions.
Diffstat (limited to 'tests')
-rw-r--r--tests/schema/tests.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/schema/tests.py b/tests/schema/tests.py
index 789b8b9ff2..a721abfe66 100644
--- a/tests/schema/tests.py
+++ b/tests/schema/tests.py
@@ -1455,13 +1455,12 @@ class SchemaTests(TransactionTestCase):
self.assertNotIn('title', self.get_indexes(Author._meta.db_table))
# Add the index
index = Index(fields=['name'], name='author_title_idx')
- index.model = Author
with connection.schema_editor() as editor:
- editor.add_index(index)
+ editor.add_index(Author, index)
self.assertIn('name', self.get_indexes(Author._meta.db_table))
# Drop the index
with connection.schema_editor() as editor:
- editor.remove_index(index)
+ editor.remove_index(Author, index)
self.assertNotIn('name', self.get_indexes(Author._meta.db_table))
def test_indexes(self):