#NEWLINE# def test_api_pkg_versions_unauthed( self ) : #NEWLINE# #INDENT# ' /api/package/<pkg>/<filename> requires write perms ' #NEWLINE# params = { #NEWLINE# #INDENT# 'content' : webtest . forms . Upload ( 'filename.txt' , 'datadatadata' ) , #NEWLINE# #UNINDENT# } #NEWLINE# url = ( '/api/package/%s/%s/' % ( self . package . name , self . package . filename ) ) #NEWLINE# response = self . app . post ( url , params , expect_errors = True , headers = _auth ( 'user' , 'user' ) ) #NEWLINE# self . assertEqual ( response . status_int , 403 )