#NEWLINE# def test_import_auth_cant_write_node( self ) : #NEWLINE# #INDENT# ea = self . ExternalAccountFactory ( ) #NEWLINE# user = AuthUserFactory ( ) #NEWLINE# user . add_addon ( self . ADDON_SHORT_NAME , auth = Auth ( user ) ) #NEWLINE# user . external_accounts . append ( ea ) #NEWLINE# user . save ( ) #NEWLINE# node = ProjectFactory ( creator = self . user ) #NEWLINE# node . add_contributor ( ea , permissions = [ permissions . READ ] , auth = self . auth , save = True ) #NEWLINE# node . add_addon ( self . ADDON_SHORT_NAME , auth = self . auth ) #NEWLINE# node . save ( ) #NEWLINE# url = node . api_url_for ( '{0}_import_auth' . format ( self . ADDON_SHORT_NAME ) ) #NEWLINE# res = self . app . put_json ( url , { #NEWLINE# #INDENT# 'external_account_id' : ea . _id , #NEWLINE# #UNINDENT# } , auth = user . auth , expect_errors = True ) #NEWLINE# assert_equal ( res . status_code , http . FORBIDDEN )