#NEWLINE# def test_deletion_rights_for_published_exploration( self ) : #NEWLINE# #INDENT# 'Test rights management for deletion of published explorations.' #NEWLINE# published_exp_id = 'published_eid' #NEWLINE# exploration = exp_domain . Exploration . create_default_exploration ( published_exp_id , 'A title' , 'A category' ) #NEWLINE# exp_services . save_new_exploration ( self . owner_id , exploration ) #NEWLINE# rights_manager . assign_role_for_exploration ( self . owner_id , published_exp_id , self . editor_id , rights_manager . ROLE_EDITOR ) #NEWLINE# rights_manager . publish_exploration ( self . owner_id , published_exp_id ) #NEWLINE# self . login ( self . EDITOR_EMAIL ) #NEWLINE# response = self . testapp . delete ( ( '/createhandler/data/%s' % published_exp_id ) , expect_errors = True ) #NEWLINE# self . assertEqual ( response . status_int , 401 ) #NEWLINE# self . logout ( ) #NEWLINE# self . login ( self . VIEWER_EMAIL ) #NEWLINE# response = self . testapp . delete ( ( '/createhandler/data/%s' % published_exp_id ) , expect_errors = True ) #NEWLINE# self . assertEqual ( response . status_int , 401 ) #NEWLINE# self . logout ( ) #NEWLINE# self . login ( self . OWNER_EMAIL ) #NEWLINE# response = self . testapp . delete ( ( '/createhandler/data/%s' % published_exp_id ) , expect_errors = True ) #NEWLINE# self . assertEqual ( response . status_int , 401 ) #NEWLINE# self . logout ( ) #NEWLINE# self . login ( self . ADMIN_EMAIL ) #NEWLINE# response = self . testapp . delete ( ( '/createhandler/data/%s' % published_exp_id ) ) #NEWLINE# self . assertEqual ( response . status_int , 200 ) #NEWLINE# self . logout ( )