diff options
| author | Nick Pope <nick.pope@flightdataservices.com> | 2017-12-05 09:19:52 +0000 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-08-02 11:53:35 -0400 |
| commit | 743d28f5539b17d6e39bd37c6e3df5628b470cac (patch) | |
| tree | e09a997ff23743b8fdf98166354ab18265e96251 /tests/postgres_tests/test_indexes.py | |
| parent | ff9543b351e79de78e7867f255ad15e51555ba4a (diff) | |
Refs #27869 -- Added PostgreSQL version check for GinIndex support.
Diffstat (limited to 'tests/postgres_tests/test_indexes.py')
| -rw-r--r-- | tests/postgres_tests/test_indexes.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/postgres_tests/test_indexes.py b/tests/postgres_tests/test_indexes.py index f4ac359a3a..b9820aa362 100644 --- a/tests/postgres_tests/test_indexes.py +++ b/tests/postgres_tests/test_indexes.py @@ -185,6 +185,16 @@ class SchemaTests(PostgreSQLTestCase): editor.remove_index(IntegerArrayModel, index) self.assertNotIn(index_name, self.get_constraints(IntegerArrayModel._meta.db_table)) + 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) + self.assertNotIn(index_name, self.get_constraints(IntegerArrayModel._meta.db_table)) + @skipUnlessDBFeature('has_brin_index_support') def test_brin_index(self): index_name = 'char_field_model_field_brin' |
