From 5bc475c6634e735e58b8cb00d95045404ccd9e4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Sat, 21 Sep 2019 21:20:08 +0200 Subject: [PATCH] tests: don't run migration tests with sqlite and newer django (#36331) --- tests/test_data_migrations.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_data_migrations.py b/tests/test_data_migrations.py index 3ae9dc39..16244ea4 100644 --- a/tests/test_data_migrations.py +++ b/tests/test_data_migrations.py @@ -1,6 +1,7 @@ import datetime import pytest +import django from django.db import connection from django.db.migrations.executor import MigrationExecutor from django.utils.timezone import make_aware @@ -11,6 +12,9 @@ pytestmark = pytest.mark.django_db def test_meeting_type_slug_migration(): + if connection.vendor == 'sqlite' and django.VERSION > (1, 11, 0): + pytest.skip('SQLite schema editor cannot be used while foreign key constraint checks are enabled.') + return executor = MigrationExecutor(connection) migrate_from = [('agendas', '0011_meetingtype_slug')] migrate_to = [('agendas', '0013_auto_20161028_1603')] @@ -33,6 +37,9 @@ def test_meeting_type_slug_migration(): def test_timeperiod_data_migrations(): + if connection.vendor == 'sqlite' and django.VERSION > (1, 11, 0): + pytest.skip('SQLite schema editor cannot be used while foreign key constraint checks are enabled.') + return executor = MigrationExecutor(connection) app = 'agendas' migrate_from = [(app, '0016_desk')]