diff --git a/tests/postgres_tests/migrations/0001_setup_extensions.py b/tests/postgres_tests/migrations/0001_setup_extensions.py index 5064f7ff99e..d0a21791ba8 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(),