mirror of
https://github.com/django/django.git
synced 2025-11-19 03:08:59 +00:00
Refs #31223 -- Added __class_getitem__() to SetPasswordMixin.
This commit is contained in:
parent
bc03f1064e
commit
d0c8f89c94
2 changed files with 6 additions and 0 deletions
|
|
@ -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):
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue