summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAkshesh <aksheshdoshi@gmail.com>2016-07-18 19:59:47 +0530
committerTim Graham <timograham@gmail.com>2016-08-02 14:21:41 -0400
commitb92c6b7d5641e927145318adaaca1156ce26ddd2 (patch)
tree1b5831aab9ba84f4a881bab16f95cedda1358784 /tests
parentef92ed530e685ea022c172f1765279a54130bd6e (diff)
Refs #26709 -- Replaced Index.get_name() with set_name_with_model().
This removes the dependency of the Index class on its 'model' attribute.
Diffstat (limited to 'tests')
-rw-r--r--tests/model_indexes/tests.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/model_indexes/tests.py b/tests/model_indexes/tests.py
index 71bd8c91c0..e979a00de7 100644
--- a/tests/model_indexes/tests.py
+++ b/tests/model_indexes/tests.py
@@ -40,19 +40,19 @@ class IndexesTests(TestCase):
def test_name_auto_generation(self):
index = models.Index(fields=['author'])
- index.model = Book
+ index.set_name_with_model(Book)
self.assertEqual(index.name, 'model_index_author_0f5565_idx')
# fields may be truncated in the name. db_column is used for naming.
long_field_index = models.Index(fields=['pages'])
- long_field_index.model = Book
+ long_field_index.set_name_with_model(Book)
self.assertEqual(long_field_index.name, 'model_index_page_co_69235a_idx')
# suffix can't be longer than 3 characters.
long_field_index.suffix = 'suff'
msg = 'Index too long for multiple database support. Is self.suffix longer than 3 characters?'
with self.assertRaisesMessage(AssertionError, msg):
- long_field_index.get_name()
+ long_field_index.set_name_with_model(Book)
def test_deconstruction(self):
index = models.Index(fields=['title'])