mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-06-28 19:31:00 -04:00
Give better error message for blacklisted password
Telling the user what to do, rather than the mistake they’ve made is usually better.
This commit is contained in:
@@ -73,7 +73,7 @@ def password(label='Password'):
|
||||
return PasswordField(label,
|
||||
validators=[DataRequired(message='Can’t be empty'),
|
||||
Length(8, 255, message='Must be at least 8 characters'),
|
||||
Blacklist(message='That password is blacklisted, too common')])
|
||||
Blacklist(message='Choose a password that’s harder to guess')])
|
||||
|
||||
|
||||
def sms_code():
|
||||
|
||||
@@ -17,7 +17,7 @@ def test_should_raise_validation_error_for_password(app_, mock_get_user_by_email
|
||||
form.password.data = password
|
||||
|
||||
form.validate()
|
||||
assert 'That password is blacklisted, too common' in form.errors['password']
|
||||
assert 'Choose a password that’s harder to guess' in form.errors['password']
|
||||
|
||||
|
||||
def test_valid_email_not_in_valid_domains(app_):
|
||||
|
||||
Reference in New Issue
Block a user