def setUp(self):
    self.apiclient = self.testClient.getApiClient()
    self.dbclient = self.testClient.getDbConnection()
    self.services = Services().services
    self.services['virtual_machine']['zoneid'] = self.zone.id
    self.account = Account.create(self.apiclient, self.services['account'], domainid=self.domain.id)
    self.template = Template.register(self.apiclient, self.services['template'], zoneid=self.zone.id, account=self.account.name, domainid=self.account.domainid)
    try:
        self.template.download(self.apiclient)
    except Exception as e:
        raise Exception(('Template download failed: %s' % e))
    self.cleanup = [self.account]
    return
def setUp(self):
    self.apiclient = self.testClient.getApiClient()
    self.dbclient = self.testClient.getDbConnection()
    self.services = Services().services
    self.services['virtual_machine']['zoneid'] = self.zone.id
    self.account = Account.create(self.apiclient, self.services['account'], domainid=self.domain.id)
    self.template = Template.register(self.apiclient, self.services['template'], zoneid=self.zone.id, account=self.account.name, domainid=self.account.domainid)
    try:
        self.template.download(self.apiclient)
    except Exception as e:
        raise Exception(('Template download failed: %s' % e))
    self.cleanup = [self.account]
    return