<s> """<STR_LIT>""" <EOL> import re <EOL> from viewfinder . backend . db . follower import Follower <EOL> from viewfinder . backend . db . viewpoint import Viewpoint <EOL> from viewfinder . backend . services . email_mgr import TestEmailManager <EOL> __authors__ = [ '<STR_LIT>' ] <EOL> from viewfinder . backend . www . test import service_base_test <EOL> class BuildArchiveTestCase ( service_base_test . ServiceBaseTestCase ) : <EOL> def setUp ( self ) : <EOL> super ( BuildArchiveTestCase , self ) . setUp ( ) <EOL> def testBuildArchive ( self ) : <EOL> """<STR_LIT>""" <EOL> self . _validate = False <EOL> self . _CreateQueryAssets ( add_test_photos = True ) <EOL> all_viewpoints = self . _validator . QueryModelObjects ( Viewpoint ) <EOL> vp_id_to_remove = all_viewpoints [ <NUM_LIT:1> ] . viewpoint_id <EOL> self . _UpdateOrAllocateDBObject ( Follower , user_id = self . _user . user_id , <EOL> viewpoint_id = vp_id_to_remove , labels = [ ] ) <EOL> self . _tester . RemoveViewpoint ( self . _cookie , vp_id_to_remove ) <EOL> follower = self . _RunAsync ( Follower . Query , self . _client , self . _user . user_id , vp_id_to_remove , None ) <EOL> self . assertTrue ( follower . IsRemoved ( ) ) <EOL> self . _tester . BuildArchive ( self . _cookie ) <EOL> self . assertEqual ( len ( TestEmailManager . Instance ( ) . emails [ '<STR_LIT>' ] ) , <NUM_LIT:1> ) <EOL> email = TestEmailManager . Instance ( ) . emails [ '<STR_LIT>' ] [ <NUM_LIT:0> ] <EOL> url = re . search ( "<STR_LIT>" , email [ '<STR_LIT:text>' ] ) . group ( "<STR_LIT:url>" ) <EOL> self . assertIsNotNone ( url ) <EOL> def _TestBuildArchive ( tester , user_cookie ) : <EOL> """<STR_LIT>""" <EOL> user_id , device_id = tester . GetIdsFromCookie ( user_cookie ) <EOL> request_dict = { '<STR_LIT:email>' : '<STR_LIT>' } <EOL> actual_dict = tester . SendRequest ( '<STR_LIT>' , user_cookie , request_dict ) <EOL> tester . _CompareResponseDicts ( '<STR_LIT>' , user_id , request_dict , { } , actual_dict ) <EOL> return actual_dict </s>
