Fixed #22514 -- Prevented indexes on virtual fields [postgres].

This commit is contained in:
Vlastimil Zíma 2014-05-19 18:19:35 +02:00 committed by Tim Graham
parent 9a46836a0c
commit 78c32f1caa
3 changed files with 34 additions and 2 deletions

View file

@ -29,3 +29,10 @@ class IndexesTests(TestCase):
# unique=True and db_index=True should only create the varchar-specific
# index (#19441).
self.assertIn('("slug" varchar_pattern_ops)', index_sql[4])
@skipUnless(connection.vendor == 'postgresql',
"This is a postgresql-specific issue")
def test_postgresql_virtual_relation_indexes(self):
"""Test indexes are not created for related objects"""
index_sql = connection.creation.sql_indexes_for_model(Article, no_style())
self.assertEqual(len(index_sql), 1)