diff options
| author | Nick Pope <nick@nickpope.me.uk> | 2023-08-23 10:04:37 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-09-12 11:51:01 +0200 |
| commit | e15174983adf0ee5caa1b678c94bb1c6fbd40402 (patch) | |
| tree | 400784e45cb70992896f5ff1f3f8be58255fb9a3 /tests | |
| parent | 8aa83464664938367a425f011a7df5663a955d09 (diff) | |
Renamed ChoicesMeta to ChoicesType.
This also uses enum.EnumType for Python 3.11+ as Python 3.11 renamed
EnumMeta to EnumType. While the former is still available as an alias
of the latter for now, let's prefer the canonical name for this.
Check out https://docs.python.org/3/library/enum.html#enum.EnumType
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/model_enums/tests.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/model_enums/tests.py b/tests/model_enums/tests.py index b010b35594..264a4b1703 100644 --- a/tests/model_enums/tests.py +++ b/tests/model_enums/tests.py @@ -6,6 +6,7 @@ import uuid from django.db import models from django.template import Context, Template from django.test import SimpleTestCase +from django.utils.deprecation import RemovedInDjango60Warning from django.utils.functional import Promise from django.utils.translation import gettext_lazy as _ @@ -315,3 +316,12 @@ class CustomChoicesTests(SimpleTestCase): class Identifier(uuid.UUID, models.Choices): A = "972ce4eb-a95f-4a56-9339-68c208a76f18" + + +class ChoicesMetaDeprecationTests(SimpleTestCase): + def test_deprecation_warning(self): + from django.db.models import enums + + msg = "ChoicesMeta is deprecated in favor of ChoicesType." + with self.assertWarnsMessage(RemovedInDjango60Warning, msg): + enums.ChoicesMeta |
