diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-05-14 06:33:00 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-14 06:33:00 +0200 |
| commit | e536fa5ce1f2249d171c5890751aea58e51b3849 (patch) | |
| tree | 53447f081c4a61b357453b038a135c09643d3a63 /tests/postgres_tests | |
| parent | 50798d43898c7d46926a4292f86fdf3859a433da (diff) | |
Fixed #31579 -- Dropped support for PostgreSQL 9.5 and PostGIS 2.2.
Diffstat (limited to 'tests/postgres_tests')
| -rw-r--r-- | tests/postgres_tests/migrations/0001_setup_extensions.py | 8 | ||||
| -rw-r--r-- | tests/postgres_tests/test_indexes.py | 12 | ||||
| -rw-r--r-- | tests/postgres_tests/test_search.py | 3 |
3 files changed, 2 insertions, 21 deletions
diff --git a/tests/postgres_tests/migrations/0001_setup_extensions.py b/tests/postgres_tests/migrations/0001_setup_extensions.py index d0a21791ba..5064f7ff99 100644 --- a/tests/postgres_tests/migrations/0001_setup_extensions.py +++ b/tests/postgres_tests/migrations/0001_setup_extensions.py @@ -1,6 +1,6 @@ from unittest import mock -from django.db import connection, migrations +from django.db import migrations try: from django.contrib.postgres.operations import ( @@ -23,11 +23,7 @@ except ImportError: class Migration(migrations.Migration): operations = [ - ( - BloomExtension() - if getattr(connection.features, 'has_bloom_index', False) - else mock.Mock() - ), + BloomExtension(), BtreeGinExtension(), BtreeGistExtension(), CITextExtension(), diff --git a/tests/postgres_tests/test_indexes.py b/tests/postgres_tests/test_indexes.py index acdf1f4771..0440beda5d 100644 --- a/tests/postgres_tests/test_indexes.py +++ b/tests/postgres_tests/test_indexes.py @@ -260,7 +260,6 @@ class SchemaTests(PostgreSQLTestCase): editor.remove_index(IntegerArrayModel, index) self.assertNotIn(index_name, self.get_constraints(IntegerArrayModel._meta.db_table)) - @skipUnlessDBFeature('has_bloom_index') def test_bloom_index(self): index_name = 'char_field_model_field_bloom' index = BloomIndex(fields=['field'], name=index_name) @@ -272,7 +271,6 @@ class SchemaTests(PostgreSQLTestCase): editor.remove_index(CharFieldModel, index) self.assertNotIn(index_name, self.get_constraints(CharFieldModel._meta.db_table)) - @skipUnlessDBFeature('has_bloom_index') def test_bloom_parameters(self): index_name = 'char_field_model_field_bloom_params' index = BloomIndex(fields=['field'], name=index_name, length=512, columns=[3]) @@ -285,16 +283,6 @@ class SchemaTests(PostgreSQLTestCase): editor.remove_index(CharFieldModel, index) self.assertNotIn(index_name, self.get_constraints(CharFieldModel._meta.db_table)) - def test_bloom_index_not_supported(self): - index_name = 'bloom_index_exception' - index = BloomIndex(fields=['field'], name=index_name) - msg = 'Bloom indexes require PostgreSQL 9.6+.' - with self.assertRaisesMessage(NotSupportedError, msg): - with mock.patch('django.db.backends.postgresql.features.DatabaseFeatures.has_bloom_index', 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_brin_index(self): index_name = 'char_field_model_field_brin' index = BrinIndex(fields=['field'], name=index_name, pages_per_range=4) diff --git a/tests/postgres_tests/test_search.py b/tests/postgres_tests/test_search.py index f6c3031bd4..65ee9ffa20 100644 --- a/tests/postgres_tests/test_search.py +++ b/tests/postgres_tests/test_search.py @@ -195,7 +195,6 @@ class MultipleFieldsTest(GrailTestData, PostgreSQLTestCase): ).filter(search=str(self.crowd.id)) self.assertSequenceEqual(searched, [self.crowd]) - @skipUnlessDBFeature('has_phraseto_tsquery') def test_phrase_search(self): line_qs = Line.objects.annotate(search=SearchVector('dialogue')) searched = line_qs.filter(search=SearchQuery('burned body his away', search_type='phrase')) @@ -203,7 +202,6 @@ class MultipleFieldsTest(GrailTestData, PostgreSQLTestCase): searched = line_qs.filter(search=SearchQuery('his body burned away', search_type='phrase')) self.assertSequenceEqual(searched, [self.verse1]) - @skipUnlessDBFeature('has_phraseto_tsquery') def test_phrase_search_with_config(self): line_qs = Line.objects.annotate( search=SearchVector('scene__setting', 'dialogue', config='french'), @@ -386,7 +384,6 @@ class TestCombinations(GrailTestData, PostgreSQLTestCase): ) self.assertSequenceEqual(searched, [self.verse2]) - @skipUnlessDBFeature('has_phraseto_tsquery') def test_combine_raw_phrase(self): searched = Line.objects.filter( dialogue__search=( |
