unit test for password restore