def _TestRemovePhotos(tester, user_cookie, request_dict):
 validator = tester.validator
 (user_id, device_id) = tester.GetIdsFromCookie(user_cookie)
 request_dict = deepcopy(request_dict)
 user = validator.GetModelObject(User, user_id)
 actual_dict = tester.SendRequest('remove_photos', user_cookie, request_dict)
 op_dict = tester._DeriveNotificationOpDict(user_id, device_id, request_dict)
 for request_ep in request_dict['episodes']:
  episode_id = request_ep['episode_id']
  episode = validator.GetModelObject(Episode, episode_id)
  for photo_id in request_ep['photo_ids']:
   post = validator.GetModelObject(Post, DBKey(episode_id, photo_id))
   if (not post.IsRemoved()):
    validator.ValidateUpdateDBObject(Post, episode_id=episode_id, photo_id=photo_id, labels=post.labels.combine().union([Post.REMOVED]))
 invalidate = {'episodes': [{'episode_id': request_ep['episode_id'], 'get_photos': True} for request_ep in request_dict['episodes']]}
 validator.ValidateNotification('remove_photos', user_id, op_dict, invalidate)
 validator.ValidateViewpointAccounting(user.private_vp_id)
 tester._CompareResponseDicts('remove_photos', user_id, request_dict, {}, actual_dict)
 return actual_dict

def _TestRemovePhotos ( tester , user_cookie , request_dict ) : validator = tester . validator ( user_id , device_id ) = tester . GetIdsFromCookie ( user_cookie ) request_dict = deepcopy ( request_dict ) user = validator . GetModelObject ( User , user_id ) actual_dict = tester . SendRequest ( 'remove_photos' , user_cookie , request_dict ) op_dict = tester . _DeriveNotificationOpDict ( user_id , device_id , request_dict ) for request_ep in request_dict [ 'episodes' ] : episode_id = request_ep [ 'episode_id' ] episode = validator . GetModelObject ( Episode , episode_id ) for photo_id in request_ep [ 'photo_ids' ] : post = validator . GetModelObject ( Post , DBKey ( episode_id , photo_id ) ) if ( not post . IsRemoved ( ) ) : validator . ValidateUpdateDBObject ( Post , episode_id = episode_id , photo_id = photo_id , labels = post . labels . combine ( ) . union ( [ Post . REMOVED ] ) ) invalidate = { 'episodes' : [ { 'episode_id' : request_ep [ 'episode_id' ] , 'get_photos' : True } for request_ep in request_dict [ 'episodes' ] ] } validator . ValidateNotification ( 'remove_photos' , user_id , op_dict , invalidate ) validator . ValidateViewpointAccounting ( user . private_vp_id ) tester . _CompareResponseDicts ( 'remove_photos' , user_id , request_dict , { } , actual_dict ) return actual_dict
called by the servicetester in order to test remove_photos service api call .