diff options
| author | Simon Charette <charette.s@gmail.com> | 2017-04-01 14:00:47 -0400 |
|---|---|---|
| committer | Simon Charette <charette.s@gmail.com> | 2017-06-20 22:59:22 -0400 |
| commit | ea91ad4c131816fd0ea8d5f1bfb21b7abd82b47e (patch) | |
| tree | 2c3ced0c291d19b630c528878a3b740c9b68af23 /tests | |
| parent | ad524980ac9644d5d40c2c79af3c183f4351841e (diff) | |
Refs #25530 -- Changed _create_index_name to take a table as first parameter.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/indexes/tests.py | 6 | ||||
| -rw-r--r-- | tests/schema/tests.py | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/indexes/tests.py b/tests/indexes/tests.py index b266d71e9a..c2d76feeb9 100644 --- a/tests/indexes/tests.py +++ b/tests/indexes/tests.py @@ -19,7 +19,7 @@ class SchemaIndexesTests(TestCase): """ with connection.schema_editor() as editor: index_name = editor._create_index_name( - model=Article, + table_name=Article._meta.db_table, column_names=("c1",), suffix="123", ) @@ -35,7 +35,7 @@ class SchemaIndexesTests(TestCase): long_name = 'l%sng' % ('o' * 100) with connection.schema_editor() as editor: index_name = editor._create_index_name( - model=Article, + table_name=Article._meta.db_table, column_names=('c1', 'c2', long_name), suffix='ix', ) @@ -56,7 +56,7 @@ class SchemaIndexesTests(TestCase): # Ensure the index name is properly quoted self.assertIn( connection.ops.quote_name( - editor._create_index_name(Article, ['headline', 'pub_date'], suffix='_idx') + editor._create_index_name(Article._meta.db_table, ['headline', 'pub_date'], suffix='_idx') ), index_sql[0] ) diff --git a/tests/schema/tests.py b/tests/schema/tests.py index ecc6aeb1c6..d2707ecea7 100644 --- a/tests/schema/tests.py +++ b/tests/schema/tests.py @@ -1640,7 +1640,7 @@ class SchemaTests(TransactionTestCase): author_index_name = index.name with connection.schema_editor() as editor: db_index_name = editor._create_index_name( - model=AuthorWithIndexedName, + table_name=AuthorWithIndexedName._meta.db_table, column_names=('name',), ) if connection.features.uppercases_column_names: |
