From 7f54af578f2e8fa9d1fe44f25d2f70047d4caae6 Mon Sep 17 00:00:00 2001 From: Lee Packham Date: Tue, 9 Sep 2014 12:24:06 +0100 Subject: [PATCH] Update test runner to work with Django 1.7 --- storages/tests/tests.py | 2 + tests.py | 10 ++++- tox.ini | 89 ++++++++++++++++++----------------------- 3 files changed, 49 insertions(+), 52 deletions(-) create mode 100644 storages/tests/tests.py diff --git a/storages/tests/tests.py b/storages/tests/tests.py new file mode 100644 index 0000000..e17e6d5 --- /dev/null +++ b/storages/tests/tests.py @@ -0,0 +1,2 @@ +from storages.tests.hashpath import * +from storages.tests.s3boto import * diff --git a/tests.py b/tests.py index 98c5536..df0461f 100644 --- a/tests.py +++ b/tests.py @@ -2,6 +2,11 @@ import os import sys import django +try: + from django.apps import apps +except ImportError: + apps = None + BASE_PATH = os.path.dirname(__file__) def main(): @@ -10,7 +15,6 @@ def main(): You can play with a django model without a complete django app installation. http://www.djangosnippets.org/snippets/1044/ """ - sys.exc_clear() os.environ["DJANGO_SETTINGS_MODULE"] = "django.conf.global_settings" from django.conf import global_settings @@ -49,6 +53,10 @@ def main(): global_settings.AWS_IS_GZIPPED = True global_settings.SECRET_KEY = "tralala" + if django.VERSION >= (1,7): + django.setup() + apps.set_installed_apps(global_settings.INSTALLED_APPS) + from django.test.utils import get_runner test_runner = get_runner(global_settings) diff --git a/tox.ini b/tox.ini index 7f7a482..a03c587 100644 --- a/tox.ini +++ b/tox.ini @@ -1,14 +1,15 @@ # content of: tox.ini , put in same dir as setup.py [tox] -envlist = django12-py26,django12-py27, - django13-py26,django13-py27, - django14-py26,django14-py27, - django15-py26,django15-py27 +envlist = django14-py27, + django15-py27, + django16-py27, + django17-py27, + django17-py34 [base] deps = mock==1.0.1 - boto==2.7.0 + boto==2.32.1 [testenv] commands=python setup.py test @@ -19,52 +20,13 @@ deps= -egit://github.com/boto/boto.git@develop#egg=boto -egit://github.com/django/django.git#egg=django -##### Django 1.2 #### - -[django12] -deps = - django==1.2.7 - {[base]deps} - -[testenv:django12-py26] -basepython=python2.6 -deps= - {[django12]deps} - -[testenv:django12-py27] -basepython=python2.7 -deps= - {[django12]deps} - -##### Django 1.3 #### - -[django13] -deps = - django==1.3.5 - {[base]deps} - -[testenv:django13-py26] -basepython=python2.6 -deps= - {[django13]deps} - -[testenv:django13-py27] -basepython=python2.7 -deps= - {[django13]deps} - ##### Django 1.4 #### [django14] deps = - django==1.4.3 + django==1.4.14 {[base]deps} -[testenv:django14-py26] -basepython=python2.6 -deps= - {[django14]deps} - [testenv:django14-py27] basepython=python2.7 deps= @@ -74,15 +36,40 @@ deps= [django15] deps = - django==1.5.1 + django==1.5.9 {[base]deps} -[testenv:django15-py26] -basepython=python2.6 -deps= - {[django15]deps} - [testenv:django15-py27] basepython=python2.7 deps= {[django15]deps} + +##### Django 1.6 #### + +[django16] +deps = + django==1.6.6 + {[base]deps} + +[testenv:django16-py27] +basepython=python2.7 +deps= + {[django16]deps} + +##### Django 1.7 #### + +[django17] +deps = + django==1.7 + {[base]deps} + +[testenv:django17-py27] +basepython=python2.7 +deps= + {[django17]deps} + +[testenv:django17-py34] +basepython=python3.4 +deps= + {[django17]deps} +