From ba778229f6d16c9b60b81857802c527b668bdf81 Mon Sep 17 00:00:00 2001 From: Dan Palmer Date: Fri, 21 Jun 2019 15:52:08 +1000 Subject: [PATCH] Fix tests for newer versions of Django --- tests/tests_migrations.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/tests_migrations.py b/tests/tests_migrations.py index 253025f..d82a8b8 100644 --- a/tests/tests_migrations.py +++ b/tests/tests_migrations.py @@ -3,6 +3,7 @@ import tempfile import subprocess +from django import VERSION from django.test import TestCase as DjangoTestCase @@ -65,6 +66,10 @@ def test_stable_migrations(self): self.assertMigrationExists('0001') self.run_command('migrate') + + if VERSION < (1, 10): + self.run_command('makemigrations tests --exit', expect_failure=True) + else: + self.run_command('makemigrations tests --check', expect_failure=True) - self.run_command('makemigrations tests --exit', expect_failure=True) self.assertMigrationExists('0002', exists=False)