'Test deleting a stack domain user.'

def test_delete_stack_domain_user(self):

    ctx = utils.dummy_context()
    self.patchobject(ctx, '_create_auth_plugin')
    ctx.trust_id = None
    self._stub_domain_admin_client()
    self.mock_admin_client.users = self.m.CreateMockAnything()
    mock_user = self.m.CreateMockAnything()
    mock_user.id = 'duser123'
    mock_user.domain_id = 'adomain123'
    mock_user.default_project_id = 'aproject'
    self.mock_admin_client.users.get('duser123').AndReturn(mock_user)
    self.mock_admin_client.users.delete('duser123').AndReturn(None)
    self.mock_admin_client.users.get('duser123').AndRaise(kc_exception.NotFound)
    self.m.ReplayAll()
    heat_ks_client = heat_keystoneclient.KeystoneClient(ctx)
    heat_ks_client.delete_stack_domain_user(user_id='duser123', project_id='aproject')
    heat_ks_client.delete_stack_domain_user(user_id='duser123', project_id='aproject')
