diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-01-31 20:42:16 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-31 20:42:16 +0100 |
| commit | a260001a2d3b2d9a7e872c24295e793bdbd10698 (patch) | |
| tree | ceb3d3d5e8882fbe32a6365756b6784f7783958d /tests/postgres_tests | |
| parent | 2e6dc72d834781a720f837817211c04980cce73d (diff) | |
Refs #30943 -- Fixed postgres_tests on PostgreSQL 9.5.
Bloom extension is available on PostgreSQL 9.6+.
Diffstat (limited to 'tests/postgres_tests')
| -rw-r--r-- | tests/postgres_tests/migrations/0001_setup_extensions.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/postgres_tests/migrations/0001_setup_extensions.py b/tests/postgres_tests/migrations/0001_setup_extensions.py index 5064f7ff99..d0a21791ba 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 migrations +from django.db import connection, migrations try: from django.contrib.postgres.operations import ( @@ -23,7 +23,11 @@ except ImportError: class Migration(migrations.Migration): operations = [ - BloomExtension(), + ( + BloomExtension() + if getattr(connection.features, 'has_bloom_index', False) + else mock.Mock() + ), BtreeGinExtension(), BtreeGistExtension(), CITextExtension(), |
