diff options
author | Raphaël Barrois <raphael.barrois@polyconseil.fr> | 2015-04-02 09:48:53 +0200 |
---|---|---|
committer | Raphaël Barrois <raphael.barrois@polyconseil.fr> | 2015-04-02 09:48:53 +0200 |
commit | c77d97d950bcf6fab0061519922c4800e06ff711 (patch) | |
tree | 28a67e6a6498e035e3d51b1772ed3876fcb015e4 /tests | |
parent | 71f5d76c5ecb2b88cd734c9f2611d7dfad1dd923 (diff) | |
download | factory-boy-c77d97d950bcf6fab0061519922c4800e06ff711.tar factory-boy-c77d97d950bcf6fab0061519922c4800e06ff711.tar.gz |
Fix imports for Django 1.8
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_django.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/test_django.py b/tests/test_django.py index ac52769..9da99cc 100644 --- a/tests/test_django.py +++ b/tests/test_django.py @@ -53,7 +53,10 @@ if django is not None: from django import test as django_test from django.conf import settings from django.db import models as django_models - from django.test import simple as django_test_simple + if django.VERSION <= (1, 8, 0): + from django.test.simple import DjangoTestSuiteRunner + else: + from django.test.runner import DiscoverRunner as DjangoTestSuiteRunner from django.test import utils as django_test_utils from django.db.models import signals from .djapp import models @@ -71,7 +74,7 @@ def setUpModule(): if django is None: # pragma: no cover raise unittest.SkipTest("Django not installed") django_test_utils.setup_test_environment() - runner = django_test_simple.DjangoTestSuiteRunner() + runner = DjangoTestSuiteRunner() runner_state = runner.setup_databases() test_state.update({ 'runner': runner, |