Refs #31223 -- Added __class_getitem__() to SetPasswordMixin.
Some checks are pending
Linters / flake8 (push) Waiting to run
Linters / isort (push) Waiting to run
Linters / black (push) Waiting to run
Tests / Windows, SQLite, Python 3.13 (push) Waiting to run
Tests / JavaScript tests (push) Waiting to run

This commit is contained in:
Thibaut Decombe 2025-07-13 20:01:02 +02:00 committed by Jacob Walls
parent bc03f1064e
commit d0c8f89c94
2 changed files with 6 additions and 0 deletions

View file

@ -134,6 +134,9 @@ class SetPasswordMixin:
user.save()
return user
def __class_getitem__(cls, *args, **kwargs):
return cls
class SetUnusablePasswordMixin:
"""

View file

@ -350,6 +350,9 @@ class BaseUserCreationFormTest(TestDataMixin, TestCase):
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):