Fixed the long lines in the AuthenticationTestCase and FlaskLoginTestCase test cases.

This commit is contained in:
2022-11-30 23:35:04 +08:00
parent 0dfdf70c45
commit bbaebbc80d
2 changed files with 6 additions and 8 deletions

View File

@ -63,9 +63,8 @@ class AuthenticationTestCase(TestCase):
auth: DigestAuth = DigestAuth(realm=_REALM)
auth.init_app(app)
user_db: t.Dict[str, User] \
= {_USERNAME: User(
_USERNAME, make_password_hash(_REALM, _USERNAME, _PASSWORD))}
pw_hash: str = make_password_hash(_REALM, _USERNAME, _PASSWORD)
user_db: t.Dict[str, User] = {_USERNAME: User(_USERNAME, pw_hash)}
@auth.register_get_password
def get_password_hash(username: str) -> t.Optional[str]: