def _TestRemoveViewpoint(tester, user_cookie, request_dict):
 validator = tester.validator
 (user_id, device_id) = tester.GetIdsFromCookie(user_cookie)
 request_dict = deepcopy(request_dict)
 viewpoint_id = request_dict['viewpoint_id']
 actual_dict = tester.SendRequest('remove_viewpoint', user_cookie, request_dict)
 op_dict = tester._DeriveNotificationOpDict(user_id, device_id, request_dict)
 request_dict['user_id'] = user_id
 follower = validator.GetModelObject(Follower, DBKey(user_id, viewpoint_id))
 if (not follower.IsRemoved()):
  labels = follower.labels.union([Follower.REMOVED])
  validator.ValidateUpdateDBObject(Follower, user_id=user_id, viewpoint_id=viewpoint_id, labels=labels)
  invalidate = {'viewpoints': [{'viewpoint_id': viewpoint_id, 'get_attributes': True}]}
  validator.ValidateNotification('remove_viewpoint', user_id, op_dict, invalidate, viewpoint_id=viewpoint_id)
 validator.ValidateViewpointAccounting(viewpoint_id)
 tester._CompareResponseDicts('remove_viewpoint', user_id, request_dict, {}, actual_dict)
 return actual_dict

def _TestRemoveViewpoint ( tester , user_cookie , request_dict ) : validator = tester . validator ( user_id , device_id ) = tester . GetIdsFromCookie ( user_cookie ) request_dict = deepcopy ( request_dict ) viewpoint_id = request_dict [ 'viewpoint_id' ] actual_dict = tester . SendRequest ( 'remove_viewpoint' , user_cookie , request_dict ) op_dict = tester . _DeriveNotificationOpDict ( user_id , device_id , request_dict ) request_dict [ 'user_id' ] = user_id follower = validator . GetModelObject ( Follower , DBKey ( user_id , viewpoint_id ) ) if ( not follower . IsRemoved ( ) ) : labels = follower . labels . union ( [ Follower . REMOVED ] ) validator . ValidateUpdateDBObject ( Follower , user_id = user_id , viewpoint_id = viewpoint_id , labels = labels ) invalidate = { 'viewpoints' : [ { 'viewpoint_id' : viewpoint_id , 'get_attributes' : True } ] } validator . ValidateNotification ( 'remove_viewpoint' , user_id , op_dict , invalidate , viewpoint_id = viewpoint_id ) validator . ValidateViewpointAccounting ( viewpoint_id ) tester . _CompareResponseDicts ( 'remove_viewpoint' , user_id , request_dict , { } , actual_dict ) return actual_dict
called by the servicetester in order to test remove_viewpoint service api call .