mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
[6.0.x] Refs #31223 -- Added __class_getitem__() to SetPasswordMixin.
Backport of d0c8f89c94 from main.
This commit is contained in:
committed by
Jacob Walls
parent
50d31aeb49
commit
b077982b3e
@@ -134,6 +134,9 @@ class SetPasswordMixin:
|
|||||||
user.save()
|
user.save()
|
||||||
return user
|
return user
|
||||||
|
|
||||||
|
def __class_getitem__(cls, *args, **kwargs):
|
||||||
|
return cls
|
||||||
|
|
||||||
|
|
||||||
class SetUnusablePasswordMixin:
|
class SetUnusablePasswordMixin:
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -350,6 +350,9 @@ class BaseUserCreationFormTest(TestDataMixin, TestCase):
|
|||||||
form.fields[field_name].widget.attrs["autocomplete"], autocomplete
|
form.fields[field_name].widget.attrs["autocomplete"], autocomplete
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def test_user_creation_form_class_getitem(self):
|
||||||
|
self.assertIs(BaseUserCreationForm["MyCustomUser"], BaseUserCreationForm)
|
||||||
|
|
||||||
|
|
||||||
class CustomUserCreationFormTest(TestDataMixin, TestCase):
|
class CustomUserCreationFormTest(TestDataMixin, TestCase):
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user