'Set up a test tenant.'

def setup_test_tenant(self, **kwargs):

    if ('name' not in kwargs):
        kwargs['name'] = data_utils.rand_name('test_tenant')
    if ('description' not in kwargs):
        kwargs['description'] = data_utils.rand_name('desc')
    tenant = self.projects_client.create_tenant(**kwargs)['tenant']
    self.addCleanup(test_utils.call_and_ignore_notfound_exc, self.tenants_client.delete_tenant, tenant['id'])
    return tenant
