Esempio n. 1
0
    def test_verify_password__False(self):
        from usersvc.models.users import User
        user = User(None, None)
        user.password_digest = 'test'
        
        with mock.patch('usersvc.models.users.verify_password') as verify_password:
            verify_password.return_value = False
            result = user.verify_password('hello')

        assert verify_password.called_once()
        assert result == False
Esempio n. 2
0
def build_user(user_info):
    user = User(user_info.uid, user_info.username)
    user.email = user_info.email
    user.is_public = user_info.is_public
    user.name_first = user_info.name_first
    user.name_last = user_info.name_last
    user.password_digest = user_info.password_digest
    user.picture_url = user_info.picture_url
    user.salt = user_info.salt
    user.url = user_info.url
    return user