Refs #30943 -- Fixed postgres_tests on PostgreSQL 9.5.

Bloom extension is available on PostgreSQL 9.6+.
This commit is contained in:
Mariusz Felisiak 2020-01-31 20:42:16 +01:00 committed by GitHub
parent 2e6dc72d83
commit a260001a2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -1,6 +1,6 @@
from unittest import mock from unittest import mock
from django.db import migrations from django.db import connection, migrations
try: try:
from django.contrib.postgres.operations import ( from django.contrib.postgres.operations import (
@ -23,7 +23,11 @@ except ImportError:
class Migration(migrations.Migration): class Migration(migrations.Migration):
operations = [ operations = [
BloomExtension(), (
BloomExtension()
if getattr(connection.features, 'has_bloom_index', False)
else mock.Mock()
),
BtreeGinExtension(), BtreeGinExtension(),
BtreeGistExtension(), BtreeGistExtension(),
CITextExtension(), CITextExtension(),