diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-01-19 12:25:20 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-19 12:25:20 +0100 |
| commit | 5371342ed66f5ff9feae9dc4586ec43830bbeca6 (patch) | |
| tree | b5c5a6f3b264770af4c34411f72c43c5b79a82ce /tests | |
| parent | 10d126198434810529e0220b0c6896ed64ca0e88 (diff) | |
Fixed #32357 -- Dropped support for PostgreSQL 9.6 and PostGIS 2.3.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/inspectdb/tests.py | 1 | ||||
| -rw-r--r-- | tests/postgres_tests/test_indexes.py | 10 | ||||
| -rw-r--r-- | tests/postgres_tests/test_operations.py | 19 | ||||
| -rw-r--r-- | tests/queries/test_explain.py | 3 |
4 files changed, 1 insertions, 32 deletions
diff --git a/tests/inspectdb/tests.py b/tests/inspectdb/tests.py index a0c4aff2e5..8be1681106 100644 --- a/tests/inspectdb/tests.py +++ b/tests/inspectdb/tests.py @@ -399,7 +399,6 @@ class InspectDBTransactionalTests(TransactionTestCase): cursor.execute('DROP MATERIALIZED VIEW inspectdb_people_materialized') @skipUnless(connection.vendor == 'postgresql', 'PostgreSQL specific SQL') - @skipUnlessDBFeature('supports_table_partitions') def test_include_partitions(self): """inspectdb --include-partitions creates models for partitions.""" with connection.cursor() as cursor: diff --git a/tests/postgres_tests/test_indexes.py b/tests/postgres_tests/test_indexes.py index 49646feb97..a212de2087 100644 --- a/tests/postgres_tests/test_indexes.py +++ b/tests/postgres_tests/test_indexes.py @@ -345,7 +345,6 @@ class SchemaTests(PostgreSQLTestCase): editor.remove_index(CharFieldModel, index) self.assertNotIn(index_name, self.get_constraints(CharFieldModel._meta.db_table)) - @skipUnlessDBFeature('has_brin_autosummarize') def test_brin_parameters(self): index_name = 'char_field_brin_params' index = BrinIndex(fields=['field'], name=index_name, autosummarize=True) @@ -358,15 +357,6 @@ class SchemaTests(PostgreSQLTestCase): editor.remove_index(CharFieldModel, index) self.assertNotIn(index_name, self.get_constraints(CharFieldModel._meta.db_table)) - def test_brin_autosummarize_not_supported(self): - 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.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)) - def test_btree_index(self): # Ensure the table is there and doesn't have an index. self.assertNotIn('field', self.get_constraints(CharFieldModel._meta.db_table)) diff --git a/tests/postgres_tests/test_operations.py b/tests/postgres_tests/test_operations.py index b914a70523..9faf938c55 100644 --- a/tests/postgres_tests/test_operations.py +++ b/tests/postgres_tests/test_operations.py @@ -298,7 +298,6 @@ class CreateCollationTests(PostgreSQLTestCase): 'deterministic': False, }) - @skipUnlessDBFeature('supports_alternate_collation_providers') def test_create_collation_alternate_provider(self): operation = CreateCollation( 'german_phonebook_test', @@ -339,24 +338,6 @@ class CreateCollationTests(PostgreSQLTestCase): with self.assertRaisesMessage(NotSupportedError, msg): operation.database_forwards(self.app_label, editor, project_state, new_state) - def test_collation_with_icu_provider_raises_error(self): - operation = CreateCollation( - 'german_phonebook', - provider='icu', - locale='de-u-co-phonebk', - ) - project_state = ProjectState() - new_state = project_state.clone() - msg = 'Non-libc providers require PostgreSQL 10+.' - with connection.schema_editor(atomic=False) as editor: - with mock.patch( - 'django.db.backends.postgresql.features.DatabaseFeatures.' - 'supports_alternate_collation_providers', - False, - ): - with self.assertRaisesMessage(NotSupportedError, msg): - operation.database_forwards(self.app_label, editor, project_state, new_state) - @unittest.skipUnless(connection.vendor == 'postgresql', 'PostgreSQL specific tests.') class RemoveCollationTests(PostgreSQLTestCase): diff --git a/tests/queries/test_explain.py b/tests/queries/test_explain.py index ba835afb74..4a22656657 100644 --- a/tests/queries/test_explain.py +++ b/tests/queries/test_explain.py @@ -52,9 +52,8 @@ class ExplainTests(TestCase): {'costs': False, 'buffers': True, 'analyze': True}, {'verbose': True, 'timing': True, 'analyze': True}, {'verbose': False, 'timing': False, 'analyze': True}, + {'summary': True}, ] - if connection.features.is_postgresql_10: - test_options.append({'summary': True}) if connection.features.is_postgresql_12: test_options.append({'settings': True}) if connection.features.is_postgresql_13: |
