From c3f32a14682839ac1e8d627c675846d2b288a0e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Dlouh=C3=BD?= Date: Wed, 29 Jun 2016 12:33:06 +0200 Subject: [PATCH 1/2] test in development Django version in allow failures mode --- .travis.yml | 45 +++++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9434ea0..397d106 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,51 +7,56 @@ python: - "3.4" - "3.5" env: - - DJANGO=">=1.4,<1.5" - - DJANGO=">=1.5,<1.6" - - DJANGO=">=1.6,<1.7" - - DJANGO=">=1.7,<1.8" - - DJANGO=">=1.8,<1.9" - - DJANGO=">=1.9,<1.10" + - DJANGO="Django>=1.4,<1.5" + - DJANGO="Django>=1.5,<1.6" + - DJANGO="Django>=1.6,<1.7" + - DJANGO="Django>=1.7,<1.8" + - DJANGO="Django>=1.8,<1.9" + - DJANGO="Django>=1.9,<1.10" + - DJANGO="https://github.com/django/django/tarball/master" matrix: exclude: - python: "3.5" - env: DJANGO=">=1.4,<1.5" + env: DJANGO="Django>=1.4,<1.5" - python: "3.5" - env: DJANGO=">=1.5,<1.6" + env: DJANGO="Django>=1.5,<1.6" - python: "3.5" - env: DJANGO=">=1.6,<1.7" + env: DJANGO="Django>=1.6,<1.7" - python: "3.5" - env: DJANGO=">=1.7,<1.8" + env: DJANGO="Django>=1.7,<1.8" - python: "3.4" - env: DJANGO=">=1.4,<1.5" + env: DJANGO="Django>=1.4,<1.5" - python: "3.4" - env: DJANGO=">=1.9,<1.10" + env: DJANGO="Django>=1.9,<1.10" - python: "3.3" - env: DJANGO=">=1.4,<1.5" + env: DJANGO="Django>=1.4,<1.5" - python: "3.3" - env: DJANGO=">=1.9,<1.10" + env: DJANGO="Django>=1.9,<1.10" - python: "3.2" - env: DJANGO=">=1.4,<1.5" + env: DJANGO="Django>=1.4,<1.5" - python: "3.2" - env: DJANGO=">=1.9,<1.10" + env: DJANGO="Django>=1.9,<1.10" - python: "2.6" - env: DJANGO=">=1.7,<1.8" + env: DJANGO="Django>=1.7,<1.8" - python: "2.6" - env: DJANGO=">=1.8,<1.9" + env: DJANGO="Django>=1.8,<1.9" - python: "2.6" - env: DJANGO=">=1.9,<1.10" + env: DJANGO="Django>=1.9,<1.10" + - python: "2.6" + env: DJANGO="https://github.com/django/django/tarball/master" + allow_failures: + - env: DJANGO="https://github.com/django/django/tarball/master" before_install: - pip install codecov install: - - pip install django$DJANGO coverage==3.6 + - pip install -q $DJANGO coverage==3.6 script: - coverage run --source=polymorphic runtests.py From 37322a75f781a0177861acc45e8b0366140260d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Dlouh=C3=BD?= Date: Wed, 29 Jun 2016 16:15:56 +0200 Subject: [PATCH 2/2] fix test template settings for Django 1.10 --- runtests.py | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/runtests.py b/runtests.py index 26b2665..d8b6d18 100755 --- a/runtests.py +++ b/runtests.py @@ -18,6 +18,16 @@ sys.stderr.write('Using Django version {0} from {1}\n'.format( ) if not settings.configured: + context_processors = [ + 'django.contrib.auth.context_processors.auth', + 'django.template.context_processors.debug', + 'django.template.context_processors.i18n', + 'django.template.context_processors.media', + 'django.template.context_processors.static', + 'django.template.context_processors.tz', + 'django.contrib.messages.context_processors.messages', + 'django.core.context_processors.request', + ] settings.configure( DEBUG=True, TEMPLATE_DEBUG=True, @@ -34,13 +44,17 @@ if not settings.configured: TEMPLATE_LOADERS=( 'django.template.loaders.app_directories.Loader', ), - TEMPLATE_CONTEXT_PROCESSORS=( - # list() is only needed for older versions of django where this is - # a tuple: - list(default_settings.TEMPLATE_CONTEXT_PROCESSORS) + [ - 'django.core.context_processors.request', - ] - ), + TEMPLATE_CONTEXT_PROCESSORS=context_processors, + TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': context_processors, + }, + }, + ], TEST_RUNNER = 'django.test.runner.DiscoverRunner' if django.VERSION >= (1, 7) else 'django.test.simple.DjangoTestSuiteRunner', INSTALLED_APPS = ( 'django.contrib.auth',