diff options
| author | Sergey Fedoseev <fedoseev.sergey@gmail.com> | 2018-11-16 20:25:26 +0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-11-19 08:59:46 -0500 |
| commit | 80ba7a881f9810404ba8a660548f1757f8243562 (patch) | |
| tree | 8e01421d66d8b26c26836befbbbd5d413a421c48 /tests/postgres_tests/test_indexes.py | |
| parent | 11bcb57ee2064d795f5f596eade244168ef5ed65 (diff) | |
Fixed cached_properties that share a common property.
The aliases aren't cached and thus the old usage will be an error after
refs #29478.
Diffstat (limited to 'tests/postgres_tests/test_indexes.py')
| -rw-r--r-- | tests/postgres_tests/test_indexes.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/postgres_tests/test_indexes.py b/tests/postgres_tests/test_indexes.py index 96ab423da7..d692b6662a 100644 --- a/tests/postgres_tests/test_indexes.py +++ b/tests/postgres_tests/test_indexes.py @@ -219,14 +219,14 @@ class SchemaTests(PostgreSQLTestCase): editor.remove_index(IntegerArrayModel, index) self.assertNotIn(index_name, self.get_constraints(IntegerArrayModel._meta.db_table)) + @mock.patch('django.db.backends.postgresql.features.DatabaseFeatures.has_gin_pending_list_limit', False) def test_gin_parameters_exception(self): index_name = 'gin_options_exception' index = GinIndex(fields=['field'], name=index_name, gin_pending_list_limit=64) msg = 'GIN option gin_pending_list_limit requires PostgreSQL 9.5+.' with self.assertRaisesMessage(NotSupportedError, msg): - with mock.patch('django.db.connection.features.has_gin_pending_list_limit', False): - with connection.schema_editor() as editor: - editor.add_index(IntegerArrayModel, index) + with connection.schema_editor() as editor: + editor.add_index(IntegerArrayModel, index) self.assertNotIn(index_name, self.get_constraints(IntegerArrayModel._meta.db_table)) @skipUnlessDBFeature('has_brin_index_support') @@ -259,7 +259,7 @@ class SchemaTests(PostgreSQLTestCase): index_name = 'brin_index_exception' index = BrinIndex(fields=['field'], name=index_name) with self.assertRaisesMessage(NotSupportedError, 'BRIN indexes require PostgreSQL 9.5+.'): - with mock.patch('django.db.connection.features.has_brin_index_support', False): + with mock.patch('django.db.backends.postgresql.features.DatabaseFeatures.has_brin_index_support', False): with connection.schema_editor() as editor: editor.add_index(CharFieldModel, index) self.assertNotIn(index_name, self.get_constraints(CharFieldModel._meta.db_table)) @@ -269,7 +269,7 @@ class SchemaTests(PostgreSQLTestCase): index_name = 'brin_options_exception' index = BrinIndex(fields=['field'], name=index_name, autosummarize=True) with self.assertRaisesMessage(NotSupportedError, 'BRIN option autosummarize requires PostgreSQL 10+.'): - with mock.patch('django.db.connection.features.has_brin_autosummarize', False): + with mock.patch('django.db.backends.postgresql.features.DatabaseFeatures.has_brin_autosummarize', False): with connection.schema_editor() as editor: editor.add_index(CharFieldModel, index) self.assertNotIn(index_name, self.get_constraints(CharFieldModel._meta.db_table)) |
