#NEWLINE# @ mock . patch . object ( keystone . api , 'keystone' ) #NEWLINE# def test_user_patch_enabled( self , kc ) : #NEWLINE# #INDENT# request = self . mock_rest_request ( body = '\n            {"enabled": false}\n        ' ) #NEWLINE# user = keystone . User ( ) #NEWLINE# kc . user_get = mock . MagicMock ( return_value = user ) #NEWLINE# response = user . patch ( request , 'user123' ) #NEWLINE# self . assertStatusCode ( response , 204 ) #NEWLINE# self . assertEqual ( response . content , b'' ) #NEWLINE# kc . user_get . assert_called_once_with ( kc , 'user123' ) #NEWLINE# kc . user_update_enabled . assert_called_once_with ( request , user , False )