'Tests api.keystone.remove_tenant_user
Verifies that remove_tenant_user is called with the right arguments
after iterating the user\'s roles.
There are no assertions in this test because the checking is handled
by mox in the VerifyAll() call in tearDown().'

def test_remove_tenant_user(self):

    keystoneclient = self.stub_keystoneclient()
    tenant = self.tenants.first()
    keystoneclient.roles = self.mox.CreateMockAnything()
    keystoneclient.roles.roles_for_user(self.user.id, tenant.id).AndReturn(self.roles)
    for role in self.roles:
        keystoneclient.roles.revoke(role.id, domain=None, group=None, project=tenant.id, user=self.user.id)
    self.mox.ReplayAll()
    api.keystone.remove_tenant_user(self.request, tenant.id, self.user.id)
