Skip to content

Commit

Permalink
Run functional tests against all modern django CMS combinations
Browse files Browse the repository at this point in the history
  • Loading branch information
bittner committed Mar 21, 2021
1 parent 7b4ea17 commit bb35ef5
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ build/
dist/
djangocms_maps.egg-info/

*.sqlite3
db.sqlite3*
12 changes: 8 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ dist: xenial

language: python
python:
- 3.5
- 3.6
- 3.7
- 3.8

env:
- TOXENV=flake8
- TOXENV=pylint
- DJANGO=2.2 CMS=3.7
- DJANGO=2.2 CMS=3.8
- DJANGO=3.0 CMS=3.7
- DJANGO=3.0 CMS=3.8
- DJANGO=3.1 CMS=3.8

install:
- pip install tox-travis
Expand All @@ -24,7 +26,9 @@ stages:

jobs:
include:
- { stage: lint, python: 3.7, env: TOXENV=bandit }
- { stage: lint, python: 3.8, env: TOXENV=flake8 }
- { stage: lint, python: 3.8, env: TOXENV=pylint }
- { stage: lint, python: 3.8, env: TOXENV=bandit }
- { stage: lint, python: 3.8, env: TOXENV=jshint }
- { stage: lint, python: 3.8, env: TOXENV=readme }

Expand Down
6 changes: 4 additions & 2 deletions tests/testproject/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
from pathlib import Path

BASE_DIR = Path(__file__).resolve().parent
BASE_DIR = Path(__file__).resolve().parent.parent

SECRET_KEY = 'insecure'
SITE_ID = 1
Expand All @@ -21,6 +21,7 @@
'menus',
'treebeard',
'sekizai',
'djangocms_maps',
]

MIDDLEWARE = [
Expand Down Expand Up @@ -61,9 +62,10 @@
WSGI_APPLICATION = 'testproject.wsgi.application'

DATABASES = {
# NOTE: str(Path) is a workaround for Django<3.1
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
'NAME': str(BASE_DIR / 'db.sqlite3'),
}
}

Expand Down
34 changes: 26 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ envlist =
flake8
pylint
bandit
py{36,37,38}-django22-cms{37,38}
py{36,37,38}-django30-cms{37,38}
py{36,37,38}-django31-cms38
jshint
readme
clean
Expand All @@ -11,12 +14,15 @@ envlist =
description = Test suite (unit + functional)
deps =
aldryn-client
django
django-cms
changedir = tests
django22: Django>=2.2,<3.0
django30: Django>=3.0,<3.1
django31: Django>=3.1,<3.2
cms37: django-cms>=3.7,<3.8
cms38: django-cms>=3.8,<3.9
commands =
python manage.py migrate -v0
python manage.py cms check
python tests/manage.py migrate -v0
python tests/manage.py cms check
python tests/manage.py shell -c "import djangocms_maps.models"

[testenv:bandit]
description = PyCQA security linter
Expand All @@ -26,9 +32,10 @@ commands = bandit -r --ini tox.ini djangocms_maps/ aldryn_config.py setup.py
[testenv:clean]
description = Remove Python bytecode and other debris
deps = pyclean
changedir = {toxinidir}
commands =
rm -rf build/ dist/ djangocms_maps.egg-info/ node_modules/
pyclean {toxinidir}
rm -rf build/ dist/ djangocms_maps.egg-info/ node_modules/ tests/db.sqlite3 tests/db.sqlite3-journal
pyclean .
whitelist_externals =
rm

Expand All @@ -49,7 +56,9 @@ commands =
[testenv:pylint]
description = Check for errors and code smells
deps =
{[testenv]deps}
aldryn-client
django
django-cms
pylint-django
commands =
pylint --rcfile tox.ini djangocms_maps setup aldryn_config
Expand All @@ -61,6 +70,15 @@ commands =
{envpython} setup.py -q sdist bdist_wheel
twine check dist/*

[travis:env]
DJANGO =
2.2: django22
3.0: django30
3.1: django31
CMS =
3.7: cms37
3.8: cms38

[bandit]
exclude = .cache,.git,.tox,build,dist,docs,tests
targets = .
Expand Down

0 comments on commit bb35ef5

Please sign in to comment.