#NEWLINE# def test_post_with_permission_denied_error( self ) : #NEWLINE# #INDENT# 'Testing the POST review-requests/<id>/screenshots/ API\n        with Permission Denied error\n        ' #NEWLINE# review_request = self . create_review_request ( ) #NEWLINE# self . assertNotEqual ( review_request . submitter , self . user ) #NEWLINE# f = open ( self . _getTrophyFilename ( ) , 'r' ) #NEWLINE# self . assertTrue ( f ) #NEWLINE# rsp = self . api_post ( get_screenshot_list_url ( review_request ) , { #NEWLINE# #INDENT# 'caption' : 'Trophy' , #NEWLINE# 'path' : f , #NEWLINE# #UNINDENT# } , expected_status = 403 ) #NEWLINE# f . close ( ) #NEWLINE# self . assertEqual ( rsp [ 'stat' ] , 'fail' ) #NEWLINE# self . assertEqual ( rsp [ 'err' ] [ 'code' ] , PERMISSION_DENIED . code )