use token to update user password
refactor: Changing the py test to use less globals and session only locally.