summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2015-04-14 00:20:33 +0200
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2015-04-14 00:20:33 +0200
commite357919cdb52af96eb67148fd38dced34981821a (patch)
tree33d6fe6b767d885980a0395418b8a3af5f0c06df /tests
parent16b414d27d638fd76701f10fe338c67d7d9dfde0 (diff)
downloadfactory-boy-e357919cdb52af96eb67148fd38dced34981821a.tar
factory-boy-e357919cdb52af96eb67148fd38dced34981821a.tar.gz
Remove warnings with Django 1.7 (Closes #195).
Builds upon pull request by @shinuza: - Properly import ``get_model`` - Run ``django.setup()`` before importing any models.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_django.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/test_django.py b/tests/test_django.py
index 9da99cc..113caeb 100644
--- a/tests/test_django.py
+++ b/tests/test_django.py
@@ -50,6 +50,8 @@ from . import tools
if django is not None:
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tests.djapp.settings')
+ if django.VERSION >= (1, 7, 0):
+ django.setup()
from django import test as django_test
from django.conf import settings
from django.db import models as django_models
@@ -64,8 +66,6 @@ if django is not None:
else:
django_test = unittest
-if django is not None and django.VERSION >= (1, 7, 0):
- django.setup()
test_state = {}