Now django.multiselectfield support Django 1.7

This commit is contained in:
Pablo Martín 2014-10-13 14:52:13 +02:00
parent b3ea613558
commit c9c7d07741
6 changed files with 37 additions and 5 deletions

View file

@ -90,4 +90,5 @@ a readily setup project that uses django-multiselectfield. You can run it as usu
::
python manage.py syncdb --noinput
python manage.py loaddata data
python manage.py runserver

View file

@ -23,6 +23,8 @@ from example.app.models import Book
class MultiSelectTestCase(TestCase):
fixtures = ['data.json']
def test_filter(self):
self.assertEqual(Book.objects.filter(tags__contains='sex').count(), 1)
self.assertEqual(Book.objects.filter(tags__contains='boring').count(), 0)

View file

@ -21,7 +21,7 @@ from os import path
DEBUG = True
TEMPLATE_DEBUG = DEBUG
BASEDIR = path.dirname(path.abspath(__file__))
BASE_DIR = path.dirname(path.abspath(__file__))
ADMINS = (
# ('Your Name', 'your_email@example.com'),
@ -70,7 +70,7 @@ USE_TZ = True
# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/var/www/example.com/media/"
MEDIA_ROOT = path.join(BASEDIR, 'media')
MEDIA_ROOT = path.join(BASE_DIR, 'media')
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
@ -81,7 +81,7 @@ MEDIA_URL = '/media/'
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/var/www/example.com/static/"
STATIC_ROOT = path.join(BASEDIR, 'static')
STATIC_ROOT = path.join(BASE_DIR, 'static')
# URL prefix for static files.
# Example: "http://example.com/static/", "http://static.example.com/"

View file

@ -30,7 +30,11 @@ if len(sys.argv) == 1:
else:
os.environ[ENVIRONMENT_VARIABLE] = sys.argv[1]
if django.VERSION[0] == 1 and django.VERSION[1] <= 5:
if django.VERSION[0] >= 1 and django.VERSION[1] >= 7:
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
if django.VERSION[0] >= 1 and django.VERSION[1] <= 5:
management.call_command('test', 'app')
else:
management.call_command('test', 'example.app')

27
tox.ini
View file

@ -1,5 +1,5 @@
[tox]
envlist = py27-dj16,py27-dj15,py27-dj14,py33-dj16,py33-dj15,py26-dj16,py26-dj15,py26-dj14
envlist = py27-dj17,py27-dj16,py27-dj15,py27-dj14,py34-dj17,py33-dj17,py33-dj16,py33-dj15,py26-dj16,py26-dj15,py26-dj14
[testenv]
usedevelop = True
@ -33,6 +33,14 @@ deps =
PyYAML==3.10
coveralls==0.3
[testenv:py27-dj17]
basepython = python2.7
deps =
django==1.7
pillow==1.7.8
PyYAML==3.10
coveralls==0.3
[testenv:py27-dj16]
basepython = python2.7
deps =
@ -58,6 +66,23 @@ deps =
PyYAML==3.10
coveralls==0.3
[testenv:py34-dj17]
basepython = python3.4
deps =
django==1.7
pillow==2.1.0
PyYAML==3.10
coveralls==0.3
[testenv:py33-dj17]
basepython = python3.3
deps =
django==1.7
pillow==2.1.0
PyYAML==3.10
coveralls==0.3
[testenv:py33-dj16]
basepython = python3.3
deps =