mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-28 00:49:49 +03:00
fix flake8 issues
This commit is contained in:
parent
04af6e6198
commit
98c56ef34a
|
@ -704,9 +704,11 @@ class PasswordValidatorSerializer(serializers.ModelSerializer):
|
||||||
password = serializers.CharField(
|
password = serializers.CharField(
|
||||||
required=True,
|
required=True,
|
||||||
write_only=True,
|
write_only=True,
|
||||||
validators=[PasswordValidator(
|
validators=[
|
||||||
custom_validators=password_validation.get_password_validators(DEFAULT_AUTH_PASSWORD_VALIDATORS)
|
PasswordValidator(
|
||||||
)]
|
custom_validators=password_validation.get_password_validators(DEFAULT_AUTH_PASSWORD_VALIDATORS)
|
||||||
|
)
|
||||||
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
@ -750,7 +752,8 @@ class TestPasswordValidator(TestCase):
|
||||||
assert not serializer.is_valid()
|
assert not serializer.is_valid()
|
||||||
assert serializer.errors == {'password': [
|
assert serializer.errors == {'password': [
|
||||||
'This password is too short. It must contain at least 8 characters.', 'This password is too common.'
|
'This password is too short. It must contain at least 8 characters.', 'This password is too common.'
|
||||||
]}
|
]
|
||||||
|
}
|
||||||
|
|
||||||
def test_password_all_numeric(self):
|
def test_password_all_numeric(self):
|
||||||
"""
|
"""
|
||||||
|
@ -760,4 +763,3 @@ class TestPasswordValidator(TestCase):
|
||||||
serializer = PasswordValidatorSerializer(data=data)
|
serializer = PasswordValidatorSerializer(data=data)
|
||||||
assert not serializer.is_valid()
|
assert not serializer.is_valid()
|
||||||
assert serializer.errors == {'password': ['This password is entirely numeric.']}
|
assert serializer.errors == {'password': ['This password is entirely numeric.']}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user