Skip to content

Commit

Permalink
Add Django 1.9/1.10 and Wagtail 1.9 to tests and requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
tm-kn authored and mvantellingen committed Jul 11, 2017
1 parent 821ee58 commit bc91d64
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 20 deletions.
17 changes: 17 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,23 @@ language: python

matrix:
include:
# Django 1.9, Wagtail 1.9
- python: 2.7
env: TOXENV=py27-django19-wagtail19
- python: 3.5
env: TOXENV=py35-django19-wagtail19
- python: 3.6
env: TOXENV=py36-django19-wagtail19

# Django 1.10, Wagtail 1.10
- python: 2.7
env: TOXENV=py27-django110-wagtail110
- python: 3.5
env: TOXENV=py35-django110-wagtail110
- python: 3.6
env: TOXENV=py36-django110-wagtail110

# Django 1.11, Wagtail 1.10
- python: 2.7
env: TOXENV=py27-django111-wagtail110
- python: 3.5
Expand Down
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ in the admin interface.

Instructions
------------
Wagtail Personalisation requires Wagtail 1.10 and Django 1.11.
Wagtail Personalisation requires Wagtail 1.9 or 1.10 and Django 1.9, 1.10 or 1.11.

To install the package with pip::

Expand Down Expand Up @@ -70,6 +70,6 @@ Sandbox
To experiment with the package you can use the sandbox provided in
this repository. To install this you will need to create and activate a
virtualenv and then run ``make sandbox``. This will start a fresh Wagtail
install, with the personalisation module enabled, on http://localhost:8000
and http://localhost:8000/cms/. The superuser credentials are
install, with the personalisation module enabled, on http://localhost:8000
and http://localhost:8000/cms/. The superuser credentials are
``superuser@example.com`` with the password ``testing``.
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


install_requires = [
'wagtail>=1.10,<1.11',
'wagtail>=1.9,<1.11',
'user-agents>=1.0.1',
'wagtailfontawesome>=1.0.6',
]
Expand Down Expand Up @@ -61,6 +61,8 @@
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Framework :: Django',
'Framework :: Django :: 1.9',
'Framework :: Django :: 1.10',
'Framework :: Django :: 1.11',
'Topic :: Internet :: WWW/HTTP :: Site Management',
],
Expand Down
33 changes: 22 additions & 11 deletions tests/settings.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
from __future__ import absolute_import, unicode_literals

import os
from pkg_resources import parse_version as V

import django


DATABASES = {
'default': {
Expand Down Expand Up @@ -52,17 +56,24 @@
},
]

MIDDLEWARE = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',

'wagtail.wagtailcore.middleware.SiteMiddleware',
)
def get_middleware_settings():
return (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',

'wagtail.wagtailcore.middleware.SiteMiddleware',
)

# Django 1.10 started to use "MIDDLEWARE" instead of "MIDDLEWARE_CLASSES".
if V(django.get_version()) < V('1.10'):
MIDDLEWARE_CLASSES = get_middleware_settings()
else:
MIDDLEWARE = get_middleware_settings()

INSTALLED_APPS = (
'wagtail_personalisation',
Expand Down
2 changes: 1 addition & 1 deletion tests/site/pages/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Migration(migrations.Migration):
initial = True

dependencies = [
('wagtailcore', '0033_remove_golive_expiry_help_text'),
('wagtailcore', '0001_initial'),
]

operations = [
Expand Down
2 changes: 1 addition & 1 deletion tests/site/pages/migrations/0002_regularpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class Migration(migrations.Migration):

dependencies = [
('wagtailcore', '0033_remove_golive_expiry_help_text'),
('wagtailcore', '0001_initial'),
('pages', '0001_initial'),
]

Expand Down
9 changes: 6 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
[tox]
envlist = py{27,35,36}-django{111}-wagtail{110},lint
envlist = py{27,35,36}-django{19,110,111}-wagtail{19,110},lint

[testenv]
commands = coverage run --parallel -m pytest {posargs}
extras = test
deps =
deps =
django19: django>=1.9,<1.10
django110: django>=1.10<1.11
django111: django>=1.11,<1.12
wagtail19: wagtail>=1.9,<1.10
wagtail110: wagtail>=1.10,<1.11

[testenv:coverage-report]
Expand All @@ -21,6 +24,6 @@ commands =
[testenv:lint]
basepython = python3.5
deps = flake8
commands =
commands =
flake8 src tests setup.py
isort -q --recursive --diff src/ tests/

0 comments on commit bc91d64

Please sign in to comment.