Skip to content

Commit

Permalink
wagtail 5.2 support
Browse files Browse the repository at this point in the history
drop python 3.8
add python 3.11 and 3.12
add wagtail 4.2, 5.0, 5.1, 5.2
  • Loading branch information
pjstevns committed Dec 1, 2023
1 parent 9aec15a commit 2e805dc
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 85 deletions.
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

tests_require = [
"mock==4.0.2",
"pytest-django==4.7.0",
"pytest==7.3.2",
# Linting
"isort[pyproject]==4.3.21",
"flake8==3.7.9",
Expand All @@ -18,9 +20,9 @@


install_requires = [
"wagtail>=4.1,<4.3",
"wagtail>=4.1,<5.3",
"Unidecode>=0.04.14,<2.0",
"wagtail-generic-chooser>=0.5.0,<0.6",
"wagtail-generic-chooser>=0.5.0,<0.7",
]

documentation_extras = [
Expand Down
5 changes: 3 additions & 2 deletions tests/blocks/test_form_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ def setUp(self):
self.form = Form.objects.get(pk=1)

def test_render(self):
self.maxDiff = None
block = WagtailFormBlock()

html = block.render(
Expand Down Expand Up @@ -53,7 +54,7 @@ def test_render(self):
"</div>"
'<div class="field-row">'
'<label for="id_email">email</label>'
'<input type="email" name="email" required id="id_email" />'
'<input type="email" maxlength="320" name="email" required id="id_email" />'
'<p class="help-text">Help</p>'
"</div>"
'<div class="field-row">'
Expand Down Expand Up @@ -153,7 +154,7 @@ def test_render(self):
"</div>"
'<div class="field-row">'
'<label for="id_email">email</label>'
'<input type="email" name="email" required id="id_email" />'
'<input type="email" maxlength="320" name="email" required id="id_email" />'
'<p class="help-text">Help</p>'
"</div>"
'<div class="field-row">'
Expand Down
1 change: 1 addition & 0 deletions tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,4 @@
LOGIN_URL = reverse_lazy("admin:login")

WAGTAILSTREAMFORMS_ADVANCED_SETTINGS_MODEL = "tests.ValidFormSettingsModel"
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
4 changes: 2 additions & 2 deletions tests/templatetags/test_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def test_render(self):
"</div>"
'<div class="field-row">'
'<label for="id_email">email</label>'
'<input type="email" name="email" required id="id_email" />'
'<input type="email" maxlength="320" name="email" required id="id_email" />'
'<p class="help-text">Help</p>'
"</div>"
'<div class="field-row">'
Expand Down Expand Up @@ -152,7 +152,7 @@ def test_render(self):
"</div>"
'<div class="field-row">'
'<label for="id_email">email</label>'
'<input type="email" name="email" required id="id_email" />'
'<input type="email" maxlength="320" name="email" required id="id_email" />'
'<p class="help-text">Help</p>'
"</div>"
'<div class="field-row">'
Expand Down
19 changes: 12 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
[tox]
envlist =
flake8
py{38,39,310}-dj{32,40,41}-wt{41,42}
py{39,310,311,312}-dj{32,40,41}-wt{41,42,50,51,52}

[gh-actions]
python =
3.8: py38
3.9: py39
"3.10": py310
"3.11": py311
"3.12": py312

[testenv]
deps =
Expand All @@ -18,14 +19,18 @@ deps =
dj41: Django>=4.1,<4.2
wt41: wagtail>=4.1,<4.2
wt42: wagtail>=4.2,<4.3
wt50: wagtail>=5.0,<5.1
wt51: wagtail>=5.1,<5.2
wt52: wagtail>=5.2,<5.3

commands =
coverage run manage.py test

basepython =
py38: python3.8
py39: python3.9
py310: python3.10
py311: python3.11
py312: python3.12

setenv =
DJANGO_SETTINGS_MODULE=tests.settings
Expand All @@ -35,7 +40,7 @@ setenv =
passenv = TOX_*

[testenv:wagtaildev]
basepython = python3.8
basepython = python3.10
install_command = pip install -e ".[test]" -U {opts} {packages}
deps =
git+https://github.com/wagtail/wagtail.git@master
Expand All @@ -47,7 +52,7 @@ commands =
ignore_errors = True

[testenv:flake8]
basepython = python3.8
basepython = python3.10
deps = flake8
commands = flake8 wagtailstreamforms

Expand All @@ -65,7 +70,7 @@ exclude =
max-line-length = 120

[testenv:coverage-report]
basepython = python3.8
basepython = python3.10
deps = coverage[toml]
skip_install = true
commands =
Expand All @@ -74,7 +79,7 @@ commands =
coverage report

[testenv:format]
basepython = python3.8
basepython = python3.10
deps =
isort
black
Expand Down
Loading

0 comments on commit 2e805dc

Please sign in to comment.