Пример #1
0
def test_user_password():
    user = User('This is me')
    assert user.check_password('badpassword') is False

    user.set_password('badpassword')
    assert '$rounds=' in user.password_hash

    assert user.check_password('badpassword') is True
    assert user.check_password('wrongpassword') is False
Пример #2
0
def test_user_password():
    user = User('This is me')
    assert user.check_password('badpassword') is False

    user.set_password('badpassword')
    assert '$rounds=' in user.password_hash

    assert user.check_password('badpassword') is True
    assert user.check_password('wrongpassword') is False