diff --git a/.travis.yml b/.travis.yml index a7bbd4d4..dcdb8d02 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,55 +8,93 @@ matrix: env: TOX_ENV='flake8' - python: 3.5 env: TOX_ENV='isort' - # Django 1.11 + + # python 3.5 + Django 1.11 + CMS 34, 35, 36, 37, 40 - python: 3.5 env: DJANGO='dj111' CMS='cms34' - python: 3.5 env: DJANGO='dj111' CMS='cms35' - python: 3.5 env: DJANGO='dj111' CMS='cms36' + - python: 3.5 + env: DJANGO='dj111' CMS='cms37' - python: 3.5 env: DJANGO='dj111' CMS='cms40' - - - python: 3.4 + # python 3.6 + Django 1.11 + CMS 34, 35, 36, 37, 40 + - python: 3.6 env: DJANGO='dj111' CMS='cms34' - - python: 3.4 + - python: 3.6 env: DJANGO='dj111' CMS='cms35' - - python: 3.4 + - python: 3.6 env: DJANGO='dj111' CMS='cms36' - - python: 3.4 + - python: 3.6 + env: DJANGO='dj111' CMS='cms37' + - python: 3.6 env: DJANGO='dj111' CMS='cms40' - - - python: 2.7 + # python 3.7 + Django 1.11 + CMS 34, 35, 36, 37, 40 + - python: 3.7 env: DJANGO='dj111' CMS='cms34' - - python: 2.7 + - python: 3.7 env: DJANGO='dj111' CMS='cms35' - - python: 2.7 + - python: 3.7 env: DJANGO='dj111' CMS='cms36' - - python: 2.7 + - python: 3.7 + env: DJANGO='dj111' CMS='cms37' + - python: 3.7 env: DJANGO='dj111' CMS='cms40' - # Django 2.0 - - python: 3.4 - env: DJANGO='dj20' CMS='cms36' + # python 3.8 + Django 1.11 + CMS 34, 35, 36, 37, 40 + - python: 3.8 + env: DJANGO='dj111' CMS='cms34' + - python: 3.8 + env: DJANGO='dj111' CMS='cms35' + - python: 3.8 + env: DJANGO='dj111' CMS='cms36' + - python: 3.8 + env: DJANGO='dj111' CMS='cms37' + - python: 3.8 + env: DJANGO='dj111' CMS='cms40' + + # python 3.5 + Django 2.0 + CMS 36, 37 - python: 3.5 env: DJANGO='dj20' CMS='cms36' + - python: 3.5 + env: DJANGO='dj20' CMS='cms37' + # python 3.6 + Django 2.0 + CMS 36, 37 - python: 3.6 env: DJANGO='dj20' CMS='cms36' - - python: 3.4 - env: DJANGO='dj20' CMS='cms40' - - python: 3.5 - env: DJANGO='dj20' CMS='cms40' - python: 3.6 - env: DJANGO='dj20' CMS='cms40' - # Django 2.1 + env: DJANGO='dj20' CMS='cms37' + # python 3.7 + Django 2.0 + CMS 36, 37 + - python: 3.7 + env: DJANGO='dj20' CMS='cms36' + - python: 3.7 + env: DJANGO='dj20' CMS='cms37' + # python 3.8 + Django 2.0 + CMS 36, 37 + - python: 3.8 + env: DJANGO='dj20' CMS='cms36' + - python: 3.8 + env: DJANGO='dj20' CMS='cms37' + + # python 3.5 + Django 2.1 + CMS 36, 37 - python: 3.5 env: DJANGO='dj21' CMS='cms36' + - python: 3.5 + env: DJANGO='dj21' CMS='cms37' + # python 3.6 + Django 2.1 + CMS 36, 37 - python: 3.6 env: DJANGO='dj21' CMS='cms36' - - python: 3.5 - env: DJANGO='dj21' CMS='cms40' - python: 3.6 - env: DJANGO='dj21' CMS='cms40' + env: DJANGO='dj21' CMS='cms37' + # python 3.7 + Django 2.1 + CMS 36, 37 + - python: 3.7 + env: DJANGO='dj21' CMS='cms36' + - python: 3.7 + env: DJANGO='dj21' CMS='cms37' + # python 3.8 + Django 2.1 + CMS 36, 37 + - python: 3.8 + env: DJANGO='dj21' CMS='cms36' + - python: 3.8 + env: DJANGO='dj21' CMS='cms37' cache: directories: @@ -64,10 +102,10 @@ cache: install: - pip install coverage isort tox - - "if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then export PY_VER=py27; fi" - - "if [[ $TRAVIS_PYTHON_VERSION == '3.4' ]]; then export PY_VER=py34; fi" - "if [[ $TRAVIS_PYTHON_VERSION == '3.5' ]]; then export PY_VER=py35; fi" - "if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then export PY_VER=py36; fi" + - "if [[ $TRAVIS_PYTHON_VERSION == '3.7' ]]; then export PY_VER=py37; fi" + - "if [[ $TRAVIS_PYTHON_VERSION == '3.8' ]]; then export PY_VER=py38; fi" - "if [[ ${DJANGO}z != 'z' ]]; then export TOX_ENV=$PY_VER-$DJANGO-$CMS; fi" script: diff --git a/README.rst b/README.rst index 67b7b1c5..18d40aa9 100644 --- a/README.rst +++ b/README.rst @@ -1,3 +1,6 @@ +.. image:: https://secure.travis-ci.org/zbohm/aldryn-forms.png?branch=fix-travis-ci + :target: http://travis-ci.com/zbohm/aldryn-forms + ================ Aldryn Forms App ================ diff --git a/setup.py b/setup.py index aa10a311..90a002ff 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ REQUIREMENTS = [ - 'django>=2.0', + 'django>=1.11', 'aldryn-boilerplates>=0.7.5', 'django-cms>=3.5', 'django-emailit', diff --git a/tests/requirements.txt b/tests/requirements.txt index 586311d9..39ecac65 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -3,5 +3,6 @@ tox>=2.9.1 coverage>=4.4.2 django-polymorphic>=1.3,<2.0 djangocms-text-ckeditor>=3.7.0 +django-simple-captcha flake8 isort diff --git a/tests/test_views.py b/tests/test_views.py index a554c06e..7254d905 100644 --- a/tests/test_views.py +++ b/tests/test_views.py @@ -33,9 +33,9 @@ def setUp(self): published=True, apphook='FormsApp', ) - try: + if CMS_3_6: self.placeholder = self.page.placeholders.get(slot='content') - except AttributeError: + else: self.placeholder = self.page.get_placeholders('en').get(slot='content') self.redirect_url = 'http://www.google.com' @@ -91,11 +91,9 @@ def reload_urls(self): def test_form_view_and_submission_with_apphook_django_gte_111(self): if CMS_3_6: public_page = self.page.publisher_public + public_placeholder = public_page.placeholders.first() else: public_page = self.page - try: - public_placeholder = public_page.placeholders.first() - except AttributeError: public_placeholder = public_page.get_placeholders('en').first() public_page_form_plugin = ( @@ -148,7 +146,10 @@ def test_view_submit_one_form_instead_multiple(self): published=True, apphook='FormsApp', ) - placeholder = page.placeholders.get(slot='content') + if CMS_3_6: + placeholder = page.placeholders.get(slot='content') + else: + placeholder = page.get_placeholders('en').get(slot='content') form_plugin = add_plugin( placeholder, @@ -200,7 +201,8 @@ def test_view_submit_one_form_instead_multiple(self): form_plugin2.action_backend = 'default' form_plugin2.save() - page.publish('en') + if CMS_3_6: + page.publish('en') self.reload_urls() self.apphook_clear() @@ -219,7 +221,10 @@ def test_view_submit_one_valid_form_instead_multiple(self): published=True, apphook='FormsApp', ) - placeholder = page.placeholders.get(slot='content') + if CMS_3_6: + placeholder = page.placeholders.get(slot='content') + else: + placeholder = page.get_placeholders('en').get(slot='content') form_plugin = add_plugin( placeholder, @@ -273,7 +278,8 @@ def test_view_submit_one_valid_form_instead_multiple(self): form_plugin2.action_backend = 'default' form_plugin2.save() - page.publish('en') + if CMS_3_6: + page.publish('en') self.reload_urls() self.apphook_clear() diff --git a/tox.ini b/tox.ini index 54abe8f5..dc9a179e 100644 --- a/tox.ini +++ b/tox.ini @@ -2,9 +2,9 @@ envlist = flake8 isort - py{27,34,35,36}-dj111-cms{34,35,36,40} - py{34,35,36}-dj20-cms{36,40} - py{35,36}-dj21-cms{36,40} + py{35,36,37,38}-dj111-cms{34,35,36,37,40} + py{35,36,37,38}-dj20-cms{36,37} + py{35,36,37,38}-dj21-cms{36,37} skip_missing_interpreters=True @@ -48,7 +48,8 @@ deps = cms34: django-cms>=3.4,<3.5 cms35: django-cms>=3.5,<3.6 cms36: django-cms>=3.6,<3.7 - cms40: https://github.com/divio/django-cms/archive/release/4.0.x.zip + cms37: django-cms>=3.7,<3.8 + cms40: git+https://github.com/divio/django-cms.git@release/4.0.x#egg=cms commands = {envpython} --version {env:COMMAND:coverage} erase