mirror of
https://github.com/django/django.git
synced 2025-05-22 06:46:27 +00:00
Fixed typo in exception message for GiST indexes and exclusion constraints.
This commit is contained in:
parent
dd26362f63
commit
000d430234
@ -126,7 +126,7 @@ class ExclusionConstraint(BaseConstraint):
|
|||||||
def check_supported(self, schema_editor):
|
def check_supported(self, schema_editor):
|
||||||
if self.include and not schema_editor.connection.features.supports_covering_gist_indexes:
|
if self.include and not schema_editor.connection.features.supports_covering_gist_indexes:
|
||||||
raise NotSupportedError(
|
raise NotSupportedError(
|
||||||
'Covering exclusion constraints requires PostgreSQL 12+.'
|
'Covering exclusion constraints require PostgreSQL 12+.'
|
||||||
)
|
)
|
||||||
|
|
||||||
def deconstruct(self):
|
def deconstruct(self):
|
||||||
|
@ -178,7 +178,7 @@ class GistIndex(PostgresIndex):
|
|||||||
|
|
||||||
def check_supported(self, schema_editor):
|
def check_supported(self, schema_editor):
|
||||||
if self.include and not schema_editor.connection.features.supports_covering_gist_indexes:
|
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):
|
class HashIndex(PostgresIndex):
|
||||||
|
@ -762,7 +762,7 @@ class ExclusionConstraintTests(PostgreSQLTestCase):
|
|||||||
expressions=[('ints', RangeOperators.ADJACENT_TO)],
|
expressions=[('ints', RangeOperators.ADJACENT_TO)],
|
||||||
include=['id'],
|
include=['id'],
|
||||||
)
|
)
|
||||||
msg = 'Covering exclusion constraints requires PostgreSQL 12+.'
|
msg = 'Covering exclusion constraints require PostgreSQL 12+.'
|
||||||
with connection.schema_editor() as editor:
|
with connection.schema_editor() as editor:
|
||||||
with mock.patch(
|
with mock.patch(
|
||||||
'django.db.backends.postgresql.features.DatabaseFeatures.supports_covering_gist_indexes',
|
'django.db.backends.postgresql.features.DatabaseFeatures.supports_covering_gist_indexes',
|
||||||
|
@ -430,7 +430,7 @@ class SchemaTests(PostgreSQLTestCase):
|
|||||||
def test_gist_include_not_supported(self):
|
def test_gist_include_not_supported(self):
|
||||||
index_name = 'gist_include_exception'
|
index_name = 'gist_include_exception'
|
||||||
index = GistIndex(fields=['scene'], name=index_name, include=['setting'])
|
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 self.assertRaisesMessage(NotSupportedError, msg):
|
||||||
with mock.patch(
|
with mock.patch(
|
||||||
'django.db.backends.postgresql.features.DatabaseFeatures.supports_covering_gist_indexes',
|
'django.db.backends.postgresql.features.DatabaseFeatures.supports_covering_gist_indexes',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user