diff options
| author | Akshesh <aksheshdoshi@gmail.com> | 2016-07-08 19:41:19 +0530 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-08-11 14:36:31 -0400 |
| commit | 324c1b432a2fa07c8f911f8b923ed04be32c52c7 (patch) | |
| tree | 7f83fedd624f56ad1ade3b128ce6667f070bc665 /tests/postgres_tests/test_array.py | |
| parent | 7aeb7390fc4231119494a9ebdee3c6ee0d5af053 (diff) | |
Fixed #24442 -- Improved SchemaEditor's index name truncation.
Diffstat (limited to 'tests/postgres_tests/test_array.py')
| -rw-r--r-- | tests/postgres_tests/test_array.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/postgres_tests/test_array.py b/tests/postgres_tests/test_array.py index 6a305556d4..6dd1fb85e0 100644 --- a/tests/postgres_tests/test_array.py +++ b/tests/postgres_tests/test_array.py @@ -448,13 +448,13 @@ class TestMigrations(TransactionTestCase): table_name = 'postgres_tests_chartextarrayindexmodel' call_command('migrate', 'postgres_tests', verbosity=0) with connection.cursor() as cursor: - like_constraint_field_names = [ - c.rsplit('_', 2)[0][len(table_name) + 1:] - for c in connection.introspection.get_constraints(cursor, table_name) - if c.endswith('_like') + like_constraint_columns_list = [ + v['columns'] + for k, v in list(connection.introspection.get_constraints(cursor, table_name).items()) + if k.endswith('_like') ] # Only the CharField should have a LIKE index. - self.assertEqual(like_constraint_field_names, ['char2']) + self.assertEqual(like_constraint_columns_list, [['char2']]) with connection.cursor() as cursor: indexes = connection.introspection.get_indexes(cursor, table_name) # All fields should have regular indexes. |
