Repository: celery/django-celery-beat (language: python)

Issue:
Fix Django 5.0 with PyPy 3.10
This PR fixes the problem of generating redundant migrations in PyPy 3.10/Django 5.0 environment.

In Django 5.0 they changed the way of normalizing choices, using [`match`](https://github.com/django/django/blob/45f778eded9dff59cfdd4dce8720daf87a08cfac/django/utils/choices.py#L76-L105).

CPython works fine with `case Iterable()`, so the choices always go through [this list comprehension](https://github.com/django/django/blob/45f778eded9dff59cfdd4dce8720daf87a08cfac/django/utils/choices.py#L109), being converted from tuples to lists every time.

PyPy 3.10-7.3.13 has a bug, it can't match `case Iterable()`, but works with `case Iterable` instead (which is wrong). So the test was failing, because the rendered schema contained `choices=[..., ...]`, while schema generated from the models containted `choices=(..., ...)`, which caused a redundant auto generated migration.

PyPy [fixed](https://foss.heptapod.net/pypy/pypy/-/commit/461b1615847a16570ec820b6562e188f80e8d73c) it in 7.3.14 though.

[Changelog](https://doc.pypy.org/en/latest/release-v7.3.14.html#id3):
> ### Python 3.10
>  <...>
>  - Pattern matching classes now use the full `isinstance` machinery, calling `__instancecheck__` too. ([#4036](https://foss.heptapod.net/pypy/pypy/-/issues/4036))

(The issue itself is unavailable, probably because they're moving to GitHub.)

So this small change of converting choices to lists fixes the problem.

Related issues and PRs:
- #698 
- #699 
- #705


Discussion / hints:

Fix patch:
diff --git a/tox.ini b/tox.ini
index 53e7f41b..7608ebb8 100644
--- a/tox.ini
+++ b/tox.ini
@@ -21,7 +21,7 @@ envlist =
     py310-django{32,41,42,50}
     py311-django{41,42,50}
     py312-django{41,42,50}
-    pypy3-django{32,41,42}
+    pypy3-django{32,41,42,50}
     flake8
     apicheck
     linkcheck


Test patch:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 93b6be3f..c62c1d7b 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -12,7 +12,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.10']
+        python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.10-v7.3.14']
 
     services:
       rabbitmq: