Update test runner to work with Django 1.7

This commit is contained in:
Lee Packham 2014-09-09 12:24:06 +01:00
Родитель 0fdc9acedc
Коммит 7f54af578f
3 изменённых файлов: 49 добавлений и 52 удалений

2
storages/tests/tests.py Normal file
Просмотреть файл

@ -0,0 +1,2 @@
from storages.tests.hashpath import *
from storages.tests.s3boto import *

Просмотреть файл

@ -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)

89
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}