Skip to content
This repository was archived by the owner on Jan 20, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 63 additions & 25 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,66 +8,104 @@ 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:
- $HOME/.wheelhouse

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:
Expand Down
3 changes: 3 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -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
================
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


REQUIREMENTS = [
'django>=2.0',
'django>=1.11',
'aldryn-boilerplates>=0.7.5',
'django-cms>=3.5',
'django-emailit',
Expand Down
1 change: 1 addition & 0 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
24 changes: 15 additions & 9 deletions tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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 = (
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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()

Expand All @@ -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,
Expand Down Expand Up @@ -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()

Expand Down
9 changes: 5 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down