diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2024-05-24 21:23:50 +0200 |
|---|---|---|
| committer | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2024-05-27 09:49:25 +0200 |
| commit | b049bec7cfe9b5854584d240addb44fa1e9375a5 (patch) | |
| tree | 802915666be8c9429530add0f621a560b5cca6be /tests/postgres_tests/test_constraints.py | |
| parent | bcbc4b9b8a4a47c8e045b060a9860a5c038192de (diff) | |
Fixed #35479 -- Dropped support for PostgreSQL 13 and PostGIS 3.0.
Diffstat (limited to 'tests/postgres_tests/test_constraints.py')
| -rw-r--r-- | tests/postgres_tests/test_constraints.py | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/tests/postgres_tests/test_constraints.py b/tests/postgres_tests/test_constraints.py index 3cc76cdcfe..770d4b1702 100644 --- a/tests/postgres_tests/test_constraints.py +++ b/tests/postgres_tests/test_constraints.py @@ -4,7 +4,7 @@ from unittest import mock from django.contrib.postgres.indexes import OpClass from django.core.checks import Error from django.core.exceptions import ValidationError -from django.db import IntegrityError, NotSupportedError, connection, transaction +from django.db import IntegrityError, connection, transaction from django.db.models import ( CASCADE, CharField, @@ -997,7 +997,6 @@ class ExclusionConstraintTests(PostgreSQLTestCase): RangesModel.objects.create(ints=(10, 19)) RangesModel.objects.create(ints=(51, 60)) - @skipUnlessDBFeature("supports_covering_spgist_indexes") def test_range_adjacent_spgist_include(self): constraint_name = "ints_adjacent_spgist_include" self.assertNotIn( @@ -1034,7 +1033,6 @@ class ExclusionConstraintTests(PostgreSQLTestCase): editor.add_constraint(RangesModel, constraint) self.assertIn(constraint_name, self.get_constraints(RangesModel._meta.db_table)) - @skipUnlessDBFeature("supports_covering_spgist_indexes") def test_range_adjacent_spgist_include_condition(self): constraint_name = "ints_adjacent_spgist_include_condition" self.assertNotIn( @@ -1067,7 +1065,6 @@ class ExclusionConstraintTests(PostgreSQLTestCase): editor.add_constraint(RangesModel, constraint) self.assertIn(constraint_name, self.get_constraints(RangesModel._meta.db_table)) - @skipUnlessDBFeature("supports_covering_spgist_indexes") def test_range_adjacent_spgist_include_deferrable(self): constraint_name = "ints_adjacent_spgist_include_deferrable" self.assertNotIn( @@ -1084,27 +1081,6 @@ class ExclusionConstraintTests(PostgreSQLTestCase): editor.add_constraint(RangesModel, constraint) self.assertIn(constraint_name, self.get_constraints(RangesModel._meta.db_table)) - def test_spgist_include_not_supported(self): - constraint_name = "ints_adjacent_spgist_include_not_supported" - constraint = ExclusionConstraint( - name=constraint_name, - expressions=[("ints", RangeOperators.ADJACENT_TO)], - index_type="spgist", - include=["id"], - ) - msg = ( - "Covering exclusion constraints using an SP-GiST index require " - "PostgreSQL 14+." - ) - with connection.schema_editor() as editor: - with mock.patch( - "django.db.backends.postgresql.features.DatabaseFeatures." - "supports_covering_spgist_indexes", - False, - ): - with self.assertRaisesMessage(NotSupportedError, msg): - editor.add_constraint(RangesModel, constraint) - def test_range_adjacent_opclass(self): constraint_name = "ints_adjacent_opclass" self.assertNotIn( @@ -1187,7 +1163,6 @@ class ExclusionConstraintTests(PostgreSQLTestCase): editor.add_constraint(RangesModel, constraint) self.assertIn(constraint_name, self.get_constraints(RangesModel._meta.db_table)) - @skipUnlessDBFeature("supports_covering_spgist_indexes") def test_range_adjacent_spgist_opclass_include(self): constraint_name = "ints_adjacent_spgist_opclass_include" self.assertNotIn( |
