From 000d4302341f49f2ec5f219d94d5dddac1a2acf5 Mon Sep 17 00:00:00 2001 From: Nick Pope Date: Fri, 23 Jul 2021 16:26:04 +0100 Subject: [PATCH] Fixed typo in exception message for GiST indexes and exclusion constraints. --- django/contrib/postgres/constraints.py | 2 +- django/contrib/postgres/indexes.py | 2 +- tests/postgres_tests/test_constraints.py | 2 +- tests/postgres_tests/test_indexes.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/django/contrib/postgres/constraints.py b/django/contrib/postgres/constraints.py index ddc9d23df9..a670628d8a 100644 --- a/django/contrib/postgres/constraints.py +++ b/django/contrib/postgres/constraints.py @@ -126,7 +126,7 @@ class ExclusionConstraint(BaseConstraint): def check_supported(self, schema_editor): if self.include and not schema_editor.connection.features.supports_covering_gist_indexes: raise NotSupportedError( - 'Covering exclusion constraints requires PostgreSQL 12+.' + 'Covering exclusion constraints require PostgreSQL 12+.' ) def deconstruct(self): diff --git a/django/contrib/postgres/indexes.py b/django/contrib/postgres/indexes.py index 2642164aa1..014bbc379d 100644 --- a/django/contrib/postgres/indexes.py +++ b/django/contrib/postgres/indexes.py @@ -178,7 +178,7 @@ class GistIndex(PostgresIndex): def check_supported(self, schema_editor): if self.include and not schema_editor.connection.features.supports_covering_gist_indexes: - raise NotSupportedError('Covering GiST indexes requires PostgreSQL 12+.') + raise NotSupportedError('Covering GiST indexes require PostgreSQL 12+.') class HashIndex(PostgresIndex): diff --git a/tests/postgres_tests/test_constraints.py b/tests/postgres_tests/test_constraints.py index 65402bd429..dfe63be61b 100644 --- a/tests/postgres_tests/test_constraints.py +++ b/tests/postgres_tests/test_constraints.py @@ -762,7 +762,7 @@ class ExclusionConstraintTests(PostgreSQLTestCase): expressions=[('ints', RangeOperators.ADJACENT_TO)], include=['id'], ) - msg = 'Covering exclusion constraints requires PostgreSQL 12+.' + msg = 'Covering exclusion constraints require PostgreSQL 12+.' with connection.schema_editor() as editor: with mock.patch( 'django.db.backends.postgresql.features.DatabaseFeatures.supports_covering_gist_indexes', diff --git a/tests/postgres_tests/test_indexes.py b/tests/postgres_tests/test_indexes.py index f449dbbb76..e5d1bb02bb 100644 --- a/tests/postgres_tests/test_indexes.py +++ b/tests/postgres_tests/test_indexes.py @@ -430,7 +430,7 @@ class SchemaTests(PostgreSQLTestCase): def test_gist_include_not_supported(self): index_name = 'gist_include_exception' index = GistIndex(fields=['scene'], name=index_name, include=['setting']) - msg = 'Covering GiST indexes requires PostgreSQL 12+.' + msg = 'Covering GiST indexes require PostgreSQL 12+.' with self.assertRaisesMessage(NotSupportedError, msg): with mock.patch( 'django.db.backends.postgresql.features.DatabaseFeatures.supports_covering_gist_indexes',