mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
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
This commit is contained in:
committed by
Mariusz Felisiak
parent
8aa8346466
commit
e15174983a
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user