mirror of
https://github.com/django/django.git
synced 2025-10-25 22:56:12 +00:00
Fixed #17944 -- Prevented an error in the user change page of the admin when the content of the password field doesn't match the expected format. Thanks saxix for the report and initial patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17775 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -65,7 +65,6 @@ class UserCreationFormTest(TestCase):
|
||||
|
||||
def test_success(self):
|
||||
# The success case.
|
||||
|
||||
data = {
|
||||
'username': 'jsmith@example.com',
|
||||
'password1': 'test123',
|
||||
@@ -236,6 +235,25 @@ class UserChangeFormTest(TestCase):
|
||||
# Just check we can create it
|
||||
form = MyUserForm({})
|
||||
|
||||
def test_bug_17944_empty_password(self):
|
||||
user = User.objects.get(username='empty_password')
|
||||
form = UserChangeForm(instance=user)
|
||||
# Just check that no error is raised.
|
||||
form.as_table()
|
||||
|
||||
def test_bug_17944_unmanageable_password(self):
|
||||
user = User.objects.get(username='unmanageable_password')
|
||||
form = UserChangeForm(instance=user)
|
||||
# Just check that no error is raised.
|
||||
form.as_table()
|
||||
|
||||
def test_bug_17944_unknown_password_algorithm(self):
|
||||
user = User.objects.get(username='unknown_password')
|
||||
form = UserChangeForm(instance=user)
|
||||
# Just check that no error is raised.
|
||||
form.as_table()
|
||||
|
||||
|
||||
UserChangeFormTest = override_settings(USE_TZ=False)(UserChangeFormTest)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user