#NEWLINE# @ mock . patch ( 'tests.test_addons_oauth.MockNodeSettings.deauthorize' ) #NEWLINE# @ mock . patch ( 'framework.auth.core._get_current_user' ) #NEWLINE# def test_revoke_auth( self , mock_decorator , mock_deauth ) : #NEWLINE# #INDENT# mock_decorator . return_value = self . user #NEWLINE# self . node_settings . set_auth ( external_account = self . external_account , user = self . user ) #NEWLINE# self . user_settings . reload ( ) #NEWLINE# assert_equal ( self . user_settings . oauth_grants , { #NEWLINE# #INDENT# self . project . _id : { #NEWLINE# #INDENT# self . external_account . _id : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . user_settings . revoke_oauth_access ( mock_decorator . external_account , auth = Auth ( self . user ) ) #NEWLINE# self . user_settings . reload ( ) #NEWLINE# assert_true ( mock_deauth . called ) #NEWLINE# assert_equal ( self . user_settings . oauth_grants , { #NEWLINE# #INDENT# self . project . _id : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } )