#NEWLINE# def test_state_download_handler_for_default_exploration( self ) : #NEWLINE# #INDENT# self . login ( state_name . EDITOR_EMAIL ) #NEWLINE# owner_id = self . get_user_id_from_email ( self . EDITOR_EMAIL ) #NEWLINE# exp_id = 'eid' #NEWLINE# self . save_new_valid_exploration ( exp_id , owner_id , title = 'The title for states download handler test!' , category = 'This is just a test category' ) #NEWLINE# exploration = exp_services . get_exploration_by_id ( exp_id ) #NEWLINE# exploration . add_states ( [ 'State A' , 'State 2' , 'State 3' ] ) #NEWLINE# exploration . states [ 'State A' ] . update_interaction_id ( 'TextInput' ) #NEWLINE# exploration . states [ 'State 2' ] . update_interaction_id ( 'TextInput' ) #NEWLINE# exploration . states [ 'State 3' ] . update_interaction_id ( 'TextInput' ) #NEWLINE# exploration . rename_state ( 'State 2' , 'State B' ) #NEWLINE# exploration . delete_state ( 'State 3' ) #NEWLINE# exp_services . _save_exploration ( owner_id , exploration , '' , [ ] ) #NEWLINE# response = self . testapp . get ( ( '/create/%s' % exp_id ) ) #NEWLINE# self . maxDiff = None #NEWLINE# state_name = 'State%20A' #NEWLINE# download_url = ( '/createhandler/download_state/%s?state=%s&width=50' % ( exp_id , state_name ) ) #NEWLINE# response = self . testapp . get ( download_url ) #NEWLINE# self . assertEqual ( self . SAMPLE_STATE_STRING , response . body ) #NEWLINE# self . logout ( )