Repository: wunderweiss/wagtail-rangefilter (language: python)

Issue:
DateTimeField crashes with django-admin-rangefilter 0.12
**Error:**
`Unsupported lookup 'range' for DateTimeField or join on the field not permitted, perhaps you meant range or regex?`

**Reason:**
The method `_get_expected_fields()` has been renamed to `expected_parameters`, see [changes](https://github.com/silentsokolov/django-admin-rangefilter/compare/v0.11.2...v0.12.0).


Discussion / hints:

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 056ce17..1edf397 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,7 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 ## [Unreleased]
 
--
+- Add tox testing for Wagtail 6.2
+- Drop tests for Wagtail < 5.2 as they have reached EOL (@katdom13)
+- Drop tests for Django < 4.2 as it has reached EOL (@katdom13)
+- Add tests for Python 3.12 (@katdom13)
+- Add `wagtail-modeladmin` to testing dependencies (@katdom13)
 
 ## [0.2.1] - 2024-02-07
 
diff --git a/README.md b/README.md
index 7688df0..b676062 100644
--- a/README.md
+++ b/README.md
@@ -16,9 +16,9 @@ Integrates [django-admin-rangefilter](https://pypi.org/project/django-admin-rang
 
 ## Supported versions
 
-- Python 3.8, 3.9, 3.10, 3.11
-- Django 3.2, 4.2
-- Wagtail 4.1, 5.1, 5.2, 6.0 (with external package [wagtail-modeladmin](https://pypi.org/project/wagtail-modeladmin/))
+- Python 3.8, 3.9, 3.10, 3.11, 3.12
+- Django 4.2, 5.0
+- Wagtail 5.2, 6.0, 6.1 (with external package [wagtail-modeladmin](https://pypi.org/project/wagtail-modeladmin/))
 
 ## Installation
 
@@ -41,9 +41,7 @@ INSTALLED_APPS = [
 ## Example usage
 
 ```python
-# Starting with Wagtail 6.0, the external package "wagtail-modeladmin" is required:
-# from wagtail_modeladmin.options import ModelAdmin
-from wagtail.contrib.modeladmin.options import ModelAdmin
+from wagtail_modeladmin.options import ModelAdmin
 from wagtail_rangefilter.filters import DateRangeFilter, DateTimeRangeFilter
 
 class ExampleAdmin(ModelAdmin):
diff --git a/pyproject.toml b/pyproject.toml
index 4f1308f..5e7265e 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -21,12 +21,11 @@ dynamic = [
 classifiers = [
     "Development Status :: 4 - Beta",
     "Framework :: Django",
-    "Framework :: Django :: 3.2",
-    "Framework :: Django :: 4.1",
     "Framework :: Django :: 4.2",
+    "Framework :: Django :: 5.0",
     "Framework :: Wagtail",
-    "Framework :: Wagtail :: 4",
     "Framework :: Wagtail :: 5",
+    "Framework :: Wagtail :: 6",
     "Intended Audience :: Developers",
     "License :: OSI Approved :: BSD License",
     "Operating System :: OS Independent",
@@ -36,18 +35,20 @@ classifiers = [
     "Programming Language :: Python :: 3.9",
     "Programming Language :: Python :: 3.10",
     "Programming Language :: Python :: 3.11",
+    "Programming Language :: Python :: 3.12",
 ]
 requires-python = ">=3.8"
 dependencies = [
     "django-admin-rangefilter>=0.12",
-    "Django>=3.2",
-    "wagtail>=4.1",
+    "Django>=4.2",
+    "wagtail>=5.2",
 ]
 
 [project.optional-dependencies]
 testing = [
-    "coverage~=6.4.4",
-    "tox~=3.26.0",
+    "coverage~=7.5.1",
+    "tox~=4.15.0",
+    "wagtail-modeladmin==2.0.0",
 ]
 
 [project.urls]
diff --git a/tox.ini b/tox.ini
index e755842..bdb0b00 100644
--- a/tox.ini
+++ b/tox.ini
@@ -3,8 +3,8 @@ skipsdist = True
 usedevelop = True
 
 envlist =
-    python{3.8,3.9,3.10,3.11}-django3.2-wagtail{4.1,5.1,5.2}-{sqlite,postgres}
-    python3.11-django4.2-wagtail{5.1,5.2,6.0}-{sqlite,postgres}
+    python{3.8,3.9,3.10,3.11}-django4.2-wagtail{5.2,6.0,6.1,6.2}
+    python{3.10,3.11,3.12}-django5.0-wagtail{5.2,6.0,6.1,6.2}
     flake8
 
 [flake8]
@@ -28,32 +28,25 @@ basepython =
     python3.9: python3.9
     python3.10: python3.10
     python3.11: python3.11
+    python3.12: python3.12
 
 deps =
     coverage
 
-    django3.2: Django>=3.2,<4.0
     django4.2: Django>=4.2,<4.3
-
-    ; The current Django version for main is 5.x, which is not supported by any Wagtail versions yet
+    django5.0: Django>=5.0,<5.1
     djangomain: git+https://github.com/django/django.git@main#egg=Django
 
-    wagtail4.1: wagtail>=4.1,<4.2
-    wagtail5.1: wagtail>=5.1,<5.2
     wagtail5.2: wagtail>=5.2,<5.3
-
-    ; Starting with wagtail 6.0 the wagtail.contrib.modeladmin module has been removed.
-    ; TODO: replace wagtail==6.0rc1 with wagtail>=6.0,<6.1 when wagtail 6.0 gets released
-    wagtail6.0: wagtail==6.0rc1
-    wagtail6.0: wagtail-modeladmin
-
+    wagtail6.0: wagtail>=6.0,<6.1
+    wagtail6.1: wagtail>=6.1,<6.2
+    wagtail6.2: wagtail>=6.2,<6.3
     wagtailmain: git+https://github.com/wagtail/wagtail.git
-    wagtailmain: wagtail-modeladmin
 
     postgres: psycopg2>=2.6
 
 [testenv:interactive]
-basepython = python3.10
+basepython = python3.12
 
 commands_pre =
     python {toxinidir}/manage.py makemigrations
@@ -68,7 +61,7 @@ setenv =
     INTERACTIVE = 1
 
 [testenv:flake8]
-basepython=python3.7
+basepython=python3.12
 deps=flake8>=2.2.0
 commands=flake8 src/wagtail_rangefilter tests/
 
@@ -78,6 +71,7 @@ python =
     3.9: python3.9
     3.10: python3.10
     3.11: python3.11
+    3.12: python3.12
 
 [gh-actions:env]
 DB_BACKEND =


Test patch:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index d670398..0072772 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -15,12 +15,12 @@ jobs:
       fail-fast: false
       max-parallel: 5
       matrix:
-        python-version: ['3.8', '3.9', '3.10', '3.11']
+        python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
 
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
       - name: Set up Python ${{ matrix.python-version }}
-        uses: actions/setup-python@v4
+        uses: actions/setup-python@v5
         with:
           python-version: ${{ matrix.python-version }}
       - name: Install Tox
@@ -39,12 +39,12 @@ jobs:
       fail-fast: false
       max-parallel: 5
       matrix:
-        python-version: ['3.8', '3.9', '3.10', '3.11']
+        python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
 
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
       - name: Set up Python ${{ matrix.python-version }}
-        uses: actions/setup-python@v4
+        uses: actions/setup-python@v5
         with:
           python-version: ${{ matrix.python-version }}
       - name: Install Tox
diff --git a/tests/settings.py b/tests/settings.py
index 44b0d0e..e7ddea2 100644
--- a/tests/settings.py
+++ b/tests/settings.py
@@ -22,12 +22,6 @@
 
 
 # Application definition
-try:
-    import wagtail_modeladmin
-except ImportError:
-    modeladmin_package_name = "wagtail.contrib.modeladmin"
-else:
-    modeladmin_package_name = "wagtail_modeladmin"
 
 INSTALLED_APPS = [
     "tests.testapp",
@@ -44,7 +38,7 @@
     "wagtail.search",
     "wagtail.admin",
     "wagtail.api.v2",
-    modeladmin_package_name,
+    "wagtail_modeladmin",
     "wagtail.contrib.routable_page",
     "wagtail.contrib.styleguide",
     "wagtail.sites",
diff --git a/tests/testapp/wagtail_hooks.py b/tests/testapp/wagtail_hooks.py
index 9df54b0..2a1cc99 100644
--- a/tests/testapp/wagtail_hooks.py
+++ b/tests/testapp/wagtail_hooks.py
@@ -1,7 +1,4 @@
-try:
-    from wagtail_modeladmin.options import ModelAdmin, modeladmin_register
-except ImportError:
-    from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register
+from wagtail_modeladmin.options import ModelAdmin, modeladmin_register
 
 from wagtail_rangefilter.filters import DateRangeFilter, DateTimeRangeFilter