[server][FaceRest] Clean up test_login() by adding a helper function.