def _TestUpdateFriend(tester, user_cookie, request_dict):
 validator = tester.validator
 (user_id, device_id) = tester.GetIdsFromCookie(user_cookie)
 request_dict = deepcopy(request_dict)
 actual_dict = tester.SendRequest('update_friend', user_cookie, request_dict)
 op_dict = tester._DeriveNotificationOpDict(user_id, device_id, request_dict)
 friend_dict = request_dict['friend']
 friend_dict['friend_id'] = friend_dict.pop('user_id')
 friend_dict['user_id'] = user_id
 validator.ValidateUpdateDBObject(Friend, **friend_dict)
 invalidate = {'users': [friend_dict['friend_id']]}
 validator.ValidateNotification('update_friend', user_id, op_dict, invalidate)
 tester._CompareResponseDicts('update_friend', user_id, request_dict, {}, actual_dict)
 return actual_dict

def _TestUpdateFriend ( tester , user_cookie , request_dict ) : validator = tester . validator ( user_id , device_id ) = tester . GetIdsFromCookie ( user_cookie ) request_dict = deepcopy ( request_dict ) actual_dict = tester . SendRequest ( 'update_friend' , user_cookie , request_dict ) op_dict = tester . _DeriveNotificationOpDict ( user_id , device_id , request_dict ) friend_dict = request_dict [ 'friend' ] friend_dict [ 'friend_id' ] = friend_dict . pop ( 'user_id' ) friend_dict [ 'user_id' ] = user_id validator . ValidateUpdateDBObject ( Friend , ** friend_dict ) invalidate = { 'users' : [ friend_dict [ 'friend_id' ] ] } validator . ValidateNotification ( 'update_friend' , user_id , op_dict , invalidate ) tester . _CompareResponseDicts ( 'update_friend' , user_id , request_dict , { } , actual_dict ) return actual_dict
called by the servicetester in order to test update_friend service api call .