Skip to content

Commit 2e805dc

Browse files
committed
wagtail 5.2 support
drop python 3.8 add python 3.11 and 3.12 add wagtail 4.2, 5.0, 5.1, 5.2
1 parent 9aec15a commit 2e805dc

File tree

6 files changed

+95
-85
lines changed

6 files changed

+95
-85
lines changed

setup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
tests_require = [
1111
"mock==4.0.2",
12+
"pytest-django==4.7.0",
13+
"pytest==7.3.2",
1214
# Linting
1315
"isort[pyproject]==4.3.21",
1416
"flake8==3.7.9",
@@ -18,9 +20,9 @@
1820

1921

2022
install_requires = [
21-
"wagtail>=4.1,<4.3",
23+
"wagtail>=4.1,<5.3",
2224
"Unidecode>=0.04.14,<2.0",
23-
"wagtail-generic-chooser>=0.5.0,<0.6",
25+
"wagtail-generic-chooser>=0.5.0,<0.7",
2426
]
2527

2628
documentation_extras = [

tests/blocks/test_form_block.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ def setUp(self):
1313
self.form = Form.objects.get(pk=1)
1414

1515
def test_render(self):
16+
self.maxDiff = None
1617
block = WagtailFormBlock()
1718

1819
html = block.render(
@@ -53,7 +54,7 @@ def test_render(self):
5354
"</div>"
5455
'<div class="field-row">'
5556
'<label for="id_email">email</label>'
56-
'<input type="email" name="email" required id="id_email" />'
57+
'<input type="email" maxlength="320" name="email" required id="id_email" />'
5758
'<p class="help-text">Help</p>'
5859
"</div>"
5960
'<div class="field-row">'
@@ -153,7 +154,7 @@ def test_render(self):
153154
"</div>"
154155
'<div class="field-row">'
155156
'<label for="id_email">email</label>'
156-
'<input type="email" name="email" required id="id_email" />'
157+
'<input type="email" maxlength="320" name="email" required id="id_email" />'
157158
'<p class="help-text">Help</p>'
158159
"</div>"
159160
'<div class="field-row">'

tests/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,4 @@
7171
LOGIN_URL = reverse_lazy("admin:login")
7272

7373
WAGTAILSTREAMFORMS_ADVANCED_SETTINGS_MODEL = "tests.ValidFormSettingsModel"
74+
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"

tests/templatetags/test_form.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def test_render(self):
5252
"</div>"
5353
'<div class="field-row">'
5454
'<label for="id_email">email</label>'
55-
'<input type="email" name="email" required id="id_email" />'
55+
'<input type="email" maxlength="320" name="email" required id="id_email" />'
5656
'<p class="help-text">Help</p>'
5757
"</div>"
5858
'<div class="field-row">'
@@ -152,7 +152,7 @@ def test_render(self):
152152
"</div>"
153153
'<div class="field-row">'
154154
'<label for="id_email">email</label>'
155-
'<input type="email" name="email" required id="id_email" />'
155+
'<input type="email" maxlength="320" name="email" required id="id_email" />'
156156
'<p class="help-text">Help</p>'
157157
"</div>"
158158
'<div class="field-row">'

tox.ini

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
[tox]
22
envlist =
33
flake8
4-
py{38,39,310}-dj{32,40,41}-wt{41,42}
4+
py{39,310,311,312}-dj{32,40,41}-wt{41,42,50,51,52}
55

66
[gh-actions]
77
python =
8-
3.8: py38
98
3.9: py39
109
"3.10": py310
10+
"3.11": py311
11+
"3.12": py312
1112

1213
[testenv]
1314
deps =
@@ -18,14 +19,18 @@ deps =
1819
dj41: Django>=4.1,<4.2
1920
wt41: wagtail>=4.1,<4.2
2021
wt42: wagtail>=4.2,<4.3
22+
wt50: wagtail>=5.0,<5.1
23+
wt51: wagtail>=5.1,<5.2
24+
wt52: wagtail>=5.2,<5.3
2125

2226
commands =
2327
coverage run manage.py test
2428

2529
basepython =
26-
py38: python3.8
2730
py39: python3.9
2831
py310: python3.10
32+
py311: python3.11
33+
py312: python3.12
2934

3035
setenv =
3136
DJANGO_SETTINGS_MODULE=tests.settings
@@ -35,7 +40,7 @@ setenv =
3540
passenv = TOX_*
3641

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

4954
[testenv:flake8]
50-
basepython = python3.8
55+
basepython = python3.10
5156
deps = flake8
5257
commands = flake8 wagtailstreamforms
5358

@@ -65,7 +70,7 @@ exclude =
6570
max-line-length = 120
6671

6772
[testenv:coverage-report]
68-
basepython = python3.8
73+
basepython = python3.10
6974
deps = coverage[toml]
7075
skip_install = true
7176
commands =
@@ -74,7 +79,7 @@ commands =
7479
coverage report
7580

7681
[testenv:format]
77-
basepython = python3.8
82+
basepython = python3.10
7883
deps =
7984
isort
8085
black

0 commit comments

Comments
 (0)