Skip to content

Commit 0740b8b

Browse files
committed
add support for Django-5.2
1 parent 294e789 commit 0740b8b

File tree

4 files changed

+18
-7
lines changed

4 files changed

+18
-7
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- name: Patch templates
3838
run: |
3939
mkdir -p adminsortable2/templates/adminsortable2/edit_inline
40-
DJANGO_VERSIONS=("4.2" "5.0" "5.1")
40+
DJANGO_VERSIONS=("4.2" "5.0" "5.1" "5.2")
4141
for django_version in ${DJANGO_VERSIONS[@]}; do
4242
echo $django_version
4343
curl --silent --output adminsortable2/templates/adminsortable2/edit_inline/stacked-django-$django_version.html https://raw.githubusercontent.com/django/django/stable/$django_version.x/django/contrib/admin/templates/admin/edit_inline/stacked.html

.github/workflows/tests.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,21 @@ jobs:
2424
strategy:
2525
matrix:
2626
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
27-
node-version: ["18.x"]
28-
django-version: ["4.2.*", "5.0.*", "5.1.*"]
27+
node-version: ["20.x"]
28+
django-version: ["4.2.*", "5.0.*", "5.1.*", "5.2.*"]
2929
exclude: # https://docs.djangoproject.com/en/5.0/faq/install/#what-python-version-can-i-use-with-django
30+
- python-version: "3.12"
31+
django-version: "4.2.*"
32+
- python-version: "3.13"
33+
django-version: "4.2.*"
3034
- python-version: "3.9"
3135
django-version: "5.0.*"
3236
- python-version: "3.9"
3337
django-version: "5.1.*"
38+
- python-version: "3.9"
39+
django-version: "5.2.*"
40+
- python-version: "3.10"
41+
django-version: "5.2.*"
3442

3543
steps:
3644
- uses: actions/checkout@v3
@@ -55,7 +63,7 @@ jobs:
5563
- name: Patch templates
5664
run: |
5765
mkdir -p adminsortable2/templates/adminsortable2/edit_inline
58-
DJANGO_VERSIONS=("4.2" "5.0" "5.1")
66+
DJANGO_VERSIONS=("4.2" "5.0" "5.1" "5.2")
5967
for django_version in ${DJANGO_VERSIONS[@]}; do
6068
echo $django_version
6169
curl --silent --output adminsortable2/templates/adminsortable2/edit_inline/stacked-django-$django_version.html https://raw.githubusercontent.com/django/django/stable/$django_version.x/django/contrib/admin/templates/admin/edit_inline/stacked.html

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def readfile(filename):
2929
'Framework :: Django :: 4.2',
3030
'Framework :: Django :: 5.0',
3131
'Framework :: Django :: 5.1',
32+
'Framework :: Django :: 5.2',
3233
]
3334

3435

testapp/test_e2e_inline.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
from time import sleep
33
from playwright.sync_api import expect
44

5+
from django import VERSION as DJANGO_VERSION
6+
57
from testapp.models import Book, Chapter
68

79

@@ -129,10 +131,11 @@ def test_create(adminpage, slug, direction, chapter, drag_selector):
129131
adminpage.get_by_label("Author:").select_option("8")
130132
adminpage.locator("#id_chapter1_set-0-title").click()
131133
adminpage.locator("#id_chapter1_set-0-title").fill("111")
132-
adminpage.get_by_role("link", name="Add another Chapter1").click()
134+
add_inline_link = "link" if DJANGO_VERSION < (5, 2) else "button"
135+
adminpage.get_by_role(add_inline_link, name="Add another Chapter1").click()
133136
adminpage.locator("#id_chapter1_set-1-title").click()
134137
adminpage.locator("#id_chapter1_set-1-title").fill("222")
135-
adminpage.get_by_role("link", name="Add another Chapter1").click()
138+
adminpage.get_by_role(add_inline_link, name="Add another Chapter1").click()
136139
adminpage.locator("#id_chapter1_set-2-title").click()
137140
adminpage.locator("#id_chapter1_set-2-title").fill("333")
138141
adminpage.get_by_role("button", name="Save", exact=True).click()
@@ -141,4 +144,3 @@ def test_create(adminpage, slug, direction, chapter, drag_selector):
141144
assert Chapter.objects.get(title="222").my_order == 2
142145
assert Chapter.objects.get(title="333").my_order == 3
143146
assert Book.objects.get(title="test").my_order != 0
144-

0 commit comments

Comments
 (0)