Refs #34118 -- Fixed CustomChoicesTests.test_uuid_unsupported on Python 3.11.4+.

5342f5e713

Follow up to 38e63c9e61.
This commit is contained in:
Mariusz Felisiak 2023-04-07 11:07:54 +02:00 committed by GitHub
parent 5b8a043bf5
commit 2eb1f37260
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 6 deletions

View File

@ -8,7 +8,6 @@ from django.template import Context, Template
from django.test import SimpleTestCase
from django.utils.functional import Promise
from django.utils.translation import gettext_lazy as _
from django.utils.version import PY312
class Suit(models.IntegerChoices):
@ -312,11 +311,7 @@ class CustomChoicesTests(SimpleTestCase):
pass
def test_uuid_unsupported(self):
if PY312:
msg = "_value_ not set in __new__, unable to create it"
else:
msg = "UUID objects are immutable"
with self.assertRaisesMessage(TypeError, msg):
with self.assertRaises(TypeError):
class Identifier(uuid.UUID, models.Choices):
A = "972ce4eb-a95f-4a56-9339-68c208a76f18"