def METHOD_NAME(self, mock_can_invite_guest, mock_has_permission):
    mock_can_invite_guest.return_val = True
    mock_has_permission.return_val = True
    # revoke
    resp = self.client.post(self.endpoint)
    self.assertEqual(200, resp.status_code)
    tmp_user = User.objects.get(self.tmp_username)
    assert len(Invitation.objects.all()) == 0
    assert tmp_user.is_active is False
    # invite again
    invite_batch_endpoint = '/api/v2.1/invitations/batch/'
    resp = self.client.post(invite_batch_endpoint, {
        'type': 'guest',
        'accepter': [self.tmp_username, ],
    })
    self.assertEqual(200, resp.status_code)
    assert len(Invitation.objects.all()) == 1
    # accept again
    self.logout()
    iv = Invitation.objects.all()[0]
    token_endpoint = reverse('invitations:token_view', args=[iv.token])
    assert iv.accept_time is None
    resp = self.client.post(token_endpoint, {
        'password': 'passwd'
    })
    self.assertEqual(302, resp.status_code)
    assert Invitation.objects.get(pk=iv.pk).accept_time is not None
    tmp_user_accept = User.objects.get(self.tmp_username)
    assert tmp_user_accept.is_active is True