ci: fix pre-commit failing on double quotes introduced by (#79807)
gitea/authentic/pipeline/head This commit looks good
Details
gitea/authentic/pipeline/head This commit looks good
Details
This commit is contained in:
parent
8ecd9b588d
commit
a88215e500
|
@ -193,7 +193,7 @@ class UserChangePasswordForm(CssClass, forms.ModelForm):
|
|||
require_password = True
|
||||
|
||||
def clean_password1(self):
|
||||
password = self.cleaned_data.get("password1")
|
||||
password = self.cleaned_data.get('password1')
|
||||
validate_password(password, user=self.instance)
|
||||
return password
|
||||
|
||||
|
|
|
@ -125,14 +125,14 @@ def test_validate_password_strength_custom_attribute(db, simple_user):
|
|||
|
||||
validate_password('0opS 1 D1t iT @GAiN', user=simple_user)
|
||||
|
||||
simple_user.attributes.favourite_song = "0opS 1 D1t iT @GAiN"
|
||||
simple_user.attributes.favourite_song = '0opS 1 D1t iT @GAiN'
|
||||
with pytest.raises(ValidationError):
|
||||
validate_password('0opS 1 D1t iT @GAiN', user=simple_user)
|
||||
|
||||
|
||||
def test_init_password_dictionaries(db, tmp_path):
|
||||
test_dictionary = tmp_path / 'dict'
|
||||
test_dictionary.write_text("0opS 1 D1t iT @GAiN\n1 pl@yed with your He@rt\n")
|
||||
test_dictionary.write_text('0opS 1 D1t iT @GAiN\n1 pl@yed with your He@rt\n')
|
||||
|
||||
LoginPasswordAuthenticator.objects.update(min_password_strength=3)
|
||||
|
||||
|
|
|
@ -139,7 +139,7 @@ def test_password_change_form(simple_user):
|
|||
name='favourite_song',
|
||||
)
|
||||
|
||||
simple_user.attributes.favourite_song = "0opS 1 D1t iT @GAiN"
|
||||
simple_user.attributes.favourite_song = '0opS 1 D1t iT @GAiN'
|
||||
|
||||
data = {
|
||||
'new_password1': 'Password0',
|
||||
|
@ -162,7 +162,7 @@ def test_password_change_form(simple_user):
|
|||
form = PasswordChangeForm(user=simple_user, data=data)
|
||||
assert form.errors['new_password1'] == ['This password is not strong enough.']
|
||||
|
||||
simple_user.attributes.favourite_song = "Baby one more time"
|
||||
simple_user.attributes.favourite_song = 'Baby one more time'
|
||||
form = PasswordChangeForm(user=simple_user, data=data)
|
||||
assert 'new_password1' not in form.errors
|
||||
|
||||
|
@ -173,7 +173,7 @@ def test_set_password_form(simple_user):
|
|||
name='favourite_song',
|
||||
)
|
||||
|
||||
simple_user.attributes.favourite_song = "0opS 1 D1t iT @GAiN"
|
||||
simple_user.attributes.favourite_song = '0opS 1 D1t iT @GAiN'
|
||||
|
||||
data = {
|
||||
'new_password1': 'Password0',
|
||||
|
@ -196,7 +196,7 @@ def test_set_password_form(simple_user):
|
|||
form = SetPasswordForm(user=simple_user, data=data)
|
||||
assert form.errors['new_password1'] == ['This password is not strong enough.']
|
||||
|
||||
simple_user.attributes.favourite_song = "Baby one more time"
|
||||
simple_user.attributes.favourite_song = 'Baby one more time'
|
||||
form = SetPasswordForm(user=simple_user, data=data)
|
||||
assert 'new_password1' not in form.errors
|
||||
|
||||
|
|
Loading…
Reference in New Issue