0
0
mirror of https://github.com/django/django.git synced 2024-11-29 22:56:46 +01:00

Fixed #25457 -- Improved formatting of password validation errors in management command output.

This commit is contained in:
Tzu-ping Chung 2015-09-25 02:18:58 +08:00 committed by Tim Graham
parent a51070e743
commit 7372cdebed
3 changed files with 3 additions and 3 deletions

View File

@ -60,7 +60,7 @@ class Command(BaseCommand):
try:
validate_password(p2, u)
except ValidationError as err:
self.stdout.write(', '.join(err.messages))
self.stderr.write('\n'.join(err.messages))
count += 1
else:
password_validated = True

View File

@ -153,7 +153,7 @@ class Command(BaseCommand):
try:
validate_password(password2, self.UserModel(**fake_user_data))
except exceptions.ValidationError as err:
self.stderr.write(', '.join(err.messages))
self.stderr.write('\n'.join(err.messages))
password = None
except KeyboardInterrupt:

View File

@ -160,7 +160,7 @@ class ChangepasswordManagementCommandTestCase(TestCase):
abort_msg = "Aborting password change for user 'joe' after 3 attempts"
with self.assertRaisesMessage(CommandError, abort_msg):
command.execute(username="joe", stdout=self.stdout, stderr=self.stderr)
self.assertIn('This password is entirely numeric.', self.stdout.getvalue())
self.assertIn('This password is entirely numeric.', self.stderr.getvalue())
def test_that_changepassword_command_works_with_nonascii_output(self):
"""