Repository: jazzband/django-polymorphic (language: python)

Issue:
Make Django 3.2 (LTS) lowest supported version
Django 3.2 is the lowest current version supported by Django https://endoflife.date/django
We should drop support up to 3.2 and add support for 4.2


Discussion / hints:
@AdamDonna - Thanks for suggesting this! If I find the bandwidth I would also help with this!
testiing with django==4.2 on my Windows machine worked fine with the following warning, which the code comments suggest to be a known issue: 

```
Using Python version 3.11. 
Using Django version 4.2 
Found 74 test(s).
Creating test database for alias 'default'...
Creating test database for alias 'secondary'...
System check identified no issues (0 silenced).
........................................
\django-polymorphic\polymorphic\tests\test_orm.py:469: DeprecationWarning: Using PolymorphicModel.base_objects is deprecated.
Use PolymorphicModelBase.objects.non_polymorphic() instead.
  a = Model2A.base_objects.get(field1="C1")
..................................
----------------------------------------------------------------------
Ran 74 tests in 5.491s

OK
Destroying test database for alias 'default'...
Destroying test database for alias 'secondary'...
@dancergraham - That's great to hear! Feel free to open a PR to fix that DeprecationWarning.
Could you also try with Django 5? Curious to see
Hah ! a lot more deprecation warnings with 5.0rc1...

```
Using Python version 3.11. 
Using Django version 5.0rc1 
Found 74 test(s).
Creating test database for alias 'default'...
Creating test database for alias 'secondary'...
System check identified no issues (0 silenced).
...\polymorphic\tests\test_multidb.py:47: RemovedInDjango51Warning: assertQuerysetEqual() is deprecated in favor of assertQuerySetEqual().
  self.assertQuerysetEqual(
\polymorphic\tests\test_multidb.py:54: RemovedInDjango51Warning: assertQuerysetEqual() is deprecated in favor of assertQuerySetEqual().
  self.assertQuerysetEqual(
\polymorphic\tests\test_multidb.py:60: RemovedInDjango51Warning: assertQuerysetEqual() is deprecated in favor of assertQuerySetEqual().
  self.assertQuerysetEqual(
\polymorphic\tests\test_multidb.py:66: RemovedInDjango51Warning: assertQuerysetEqual() is deprecated in favor of assertQuerySetEqual().
  self.assertQuerysetEqual(
....\polymorphic\tests\test_multidb.py:29: RemovedInDjango51Warning: assertQuerysetEqual() is deprecated in favor of assertQuerySetEqual().
  self.assertQuerysetEqual(
\polymorphic\tests\test_multidb.py:35: RemovedInDjango51Warning: assertQuerysetEqual() is deprecated in favor of assertQuerySetEqual().
  self.assertQuerysetEqual(
.\polymorphic\tests\test_regression.py:21: RemovedInDjango51Warning: assertQuerysetEqual() is deprecated in favor of assertQuerySetEqual().
  self.assertQuerysetEqual(
\polymorphic\tests\test_regression.py:26: RemovedInDjango51Warning: assertQuerysetEqual() is deprecated in favor of assertQuerySetEqual().
  self.assertQuerysetEqual(
\polymorphic\tests\test_regression.py:31: RemovedInDjango51Warning: assertQuerysetEqual() is deprecated in favor of assertQuerySetEqual().
  self.assertQuerysetEqual(
................\polymorphic\tests\test_orm.py:663: RemovedInDjango51Warning: assertQuerysetEqual() is deprecated in favor of assertQuerySetEqual().
  self.assertQuerysetEqual(
.\polymorphic\tests\test_orm.py:534: RemovedInDjango51Warning: assertQuerysetEqual() is deprecated in favor of assertQuerySetEqual().
  self.assertQuerysetEqual(
\polymorphic\tests\test_orm.py:543: RemovedInDjango51Warning: assertQuerysetEqual() is deprecated in favor of assertQuerySetEqual().
  self.assertQuerysetEqual(objects, [Model2B, Model2A], transform=lambda o: o.__class__)
...\polymorphic\tests\test_orm.py:348: RemovedInDjango51Warning: assertQuerysetEqual() is deprecated in favor of assertQuerySetEqual().
  self.assertQuerysetEqual(
\polymorphic\tests\test_orm.py:356: RemovedInDjango51Warning: assertQuerysetEqual() is deprecated in favor of assertQuerySetEqual().
  self.assertQuerysetEqual(
\polymorphic\tests\test_orm.py:364: RemovedInDjango51Warning: assertQuerysetEqual() is deprecated in favor of assertQuerySetEqual().
  self.assertQuerysetEqual(objects, [], transform=lambda o: o.__class__)
..\polymorphic\tests\test_orm.py:574: RemovedInDjango51Warning: assertQuerysetEqual() is deprecated in favor of assertQuerySetEqual().
  self.assertQuerysetEqual(
\polymorphic\tests\test_orm.py:582: RemovedInDjango51Warning: assertQuerysetEqual() is deprecated in favor of assertQuerySetEqual().
  self.assertQuerysetEqual(
\polymorphic\tests\test_orm.py:590: RemovedInDjango51Warning: assertQuerysetEqual() is deprecated in favor of assertQuerySetEqual().
  self.assertQuerysetEqual(
\polymorphic\tests\test_orm.py:598: RemovedInDjango51Warning: assertQuerysetEqual() is deprecated in favor of assertQuerySetEqual().
  self.assertQuerysetEqual(
.....\polymorphic\tests\test_orm.py:523: RemovedInDjango51Warning: assertQuerysetEqual() is deprecated in favor of assertQuerySetEqual().
  self.assertQuerysetEqual(
..\polymorphic\tests\test_orm.py:336: RemovedInDjango51Warning: assertQuerysetEqual() is deprecated in favor of assertQuerySetEqual().
  self.assertQuerysetEqual(
...\polymorphic\tests\test_orm.py:469: DeprecationWarning: Using PolymorphicModel.base_objects is deprecated.
Use PolymorphicModelBase.objects.non_polymorphic() instead.
  a = Model2A.base_objects.get(field1="C1")
..\polymorphic\tests\test_orm.py:606: RemovedInDjango51Warning: assertQuerysetEqual() is deprecated in favor of assertQuerySetEqual().
  self.assertQuerysetEqual(
.......\polymorphic\tests\test_orm.py:617: RemovedInDjango51Warning: assertQuerysetEqual() is deprecated in favor of assertQuerySetEqual().
  self.assertQuerysetEqual(
..............\polymorphic\tests\test_orm.py:224: RemovedInDjango51Warning: assertQuerysetEqual() is deprecated in favor of assertQuerySetEqual().
  self.assertQuerysetEqual(
.\polymorphic\tests\test_orm.py:401: RemovedInDjango51Warning: assertQuerysetEqual() is deprecated in favor of assertQuerySetEqual().
  self.assertQuerysetEqual(
.\polymorphic\tests\test_orm.py:767: RemovedInDjango51Warning: assertQuerysetEqual() is deprecated in favor of assertQuerySetEqual().
  self.assertQuerysetEqual(
.\polymorphic\tests\test_orm.py:783: RemovedInDjango51Warning: assertQuerysetEqual() is deprecated in favor of assertQuerySetEqual().
  self.assertQuerysetEqual(
.\polymorphic\tests\test_orm.py:811: RemovedInDjango51Warning: assertQuerysetEqual() is deprecated in favor of assertQuerySetEqual().
  self.assertQuerysetEqual(
....\polymorphic\tests\test_utils.py:37: RemovedInDjango51Warning: assertQuerysetEqual() is deprecated in favor of assertQuerySetEqual().
  self.assertQuerysetEqual(
...
----------------------------------------------------------------------
Ran 74 tests in 6.306s

OK
@dancergraham - Feel free to start a PR trying to update to django 4.2 and 5.2
If we get #560 and #561 merged, we'd have a good CI/CD backbone to continue on.

Fix patch:
diff --git a/pyproject.toml b/pyproject.toml
index 6daff4ac..9e8df09b 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -2,7 +2,7 @@
 requires = [
     "setuptools",
     # TODO: look into using python-babel instead of requiring django at build time
-    "django>=2.1",  # for makemessages
+    "django>=3.2",  # for makemessages
 ]
 
 [tool.isort]
diff --git a/setup.cfg b/setup.cfg
index 09a3300b..a7486833 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -14,27 +14,28 @@ classifiers =
 	Development Status :: 5 - Production/Stable
 	Environment :: Web Environment
 	Framework :: Django
-	Framework :: Django :: 2.2
-	Framework :: Django :: 3.0
-	Framework :: Django :: 3.1
 	Framework :: Django :: 3.2
 	Framework :: Django :: 4.0
+	Framework :: Django :: 4.1
+	Framework :: Django :: 4.2
+	Framework :: Django :: 5.0
 	Intended Audience :: Developers
 	License :: OSI Approved :: BSD License
 	Operating System :: OS Independent
 	Programming Language :: Python :: 3
 	Programming Language :: Python :: 3 :: Only
-	Programming Language :: Python :: 3.6
-	Programming Language :: Python :: 3.7
 	Programming Language :: Python :: 3.8
 	Programming Language :: Python :: 3.9
+	Programming Language :: Python :: 3.10
+	Programming Language :: Python :: 3.11
+	Programming Language :: Python :: 3.12
 	Topic :: Database
 
 [options]
 packages = find:
 include_package_data = True
 install_requires =
-	Django >= 2.1
+	Django >= 3.2
 
 [options.packages.find]
 exclude =
diff --git a/tox.ini b/tox.ini
index 73e27c7f..c129822d 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,9 +1,8 @@
 [tox]
 envlist =
-	py36-django{22,30,31}
-	py37-django{22,30,31}
-	py38-django{22,30,31,32}
-	py{39,310}-django{40,41,42}
+	py{38,39,310}-django{32}
+	py{38,39,310,311,312}-django{40,41,42}
+	py{310,311,312}-django{50}
 	# TODO: reinstate running on postgres: py39-django{40}-postgres
 	docs
 
@@ -15,12 +14,11 @@ setenv =
 deps =
 	coverage
 	dj-database-url
-	django22: Django ~= 2.2
-	django30: Django ~= 3.0
-	django31: Django ~= 3.1
+	django32: Django ~= 3.2
 	django40: Django ~= 4.0
 	django41: Django ~= 4.1
 	django42: Django ~= 4.2
+	django50: Django ~= 5.0
 	djangomain: https://github.com/django/django/archive/main.tar.gz
 	postgres: psycopg2
 commands =
@@ -36,9 +34,8 @@ commands = sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
 
 [gh-actions]
 python =
-    3.6: py36
-    3.7: py37
     3.8: py38
     3.9: py39
     3.10: py310
     3.11: py311
+    3.12: py312


Test patch:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 96b71a72..82b9ac6a 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -22,21 +22,16 @@ jobs:
           name: dist
           path: dist/
   Test:
-    runs-on: ${{ matrix.os }}
+    runs-on: ubuntu-latest
     strategy:
       fail-fast: true
       matrix:
         include:
-          - os: ubuntu-20.04
-            python-version: "3.6"
-          - os: ubuntu-20.04
-            python-version: "3.7"
-          - os: ubuntu-22.04
-            python-version: "3.8"
-          - os: ubuntu-22.04
-            python-version: "3.9"
-          - os: ubuntu-22.04
-            python-version: "3.10"
+          - python-version: "3.8"
+          - python-version: "3.9"
+          - python-version: "3.10"
+          - python-version: "3.11"
+          - python-version: "3.12"
     steps:
       - uses: actions/checkout@v4
       - name: "Set up Python ${{ matrix.python-version }}"