Skip to content

Commit

Permalink
Added password validators tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpro2022 committed Dec 8, 2023
1 parent c1fbb7b commit 157c2c4
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions app/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@

def password_length_validator(password: str):
if len(password) < settings.password_length:
raise InvalidPasswordException(
f'Пароль должен быть длиной не менее '
f'{settings.password_length} символов.')
raise InvalidPasswordException(f'Пароль должен быть длиной не менее {settings.password_length} символов.')


def password_content_validator(password: str, email: str):
if email in password:
raise InvalidPasswordException(
'В пароле не должно содержаться e-mail.')
raise InvalidPasswordException('В пароле не должно содержаться e-mail.')

0 comments on commit 157c2c4

Please sign in to comment.