From e357919cdb52af96eb67148fd38dced34981821a Mon Sep 17 00:00:00 2001 From: Raphaƫl Barrois Date: Tue, 14 Apr 2015 00:20:33 +0200 Subject: 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. --- tests/test_django.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') 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 = {} -- cgit v1.2.3