def setUp(self):
        super(BackupQueryTest, self).setUp()
        self.context = _prep_conf(utils.utcnow())
        current_time = str(utils.utcnow())
        self.instance_id = 'INSTANCE-' + current_time

        self.snapshot = models.DBBackup.create(tenant_id=self.context.tenant,
                                             name=BACKUP_NAME,
                                             state=BACKUP_STATE,
                                             instance_id=self.instance_id,
                                             deleted=False,
                                             size=2.0,
                                             location=BACKUP_LOCATION,
                                             group_id=GROUP_ID,
                                             type= TYPE)
        import time
        time.sleep(2)
        expire_at = int(time.time()) - (2 * 24 * 60 * 60)
        self.backup = models.DBBackup.create(tenant_id=self.context.tenant,
                                             name=BACKUP_NAME,
                                             state=BACKUP_STATE,
                                             instance_id=self.instance_id,
                                             deleted=False,
                                             size=2.0,
                                             location=BACKUP_LOCATION,
                                             group_id=GROUP_ID,
                                             type= BACKUP_TYPE,
                                             expire_at = expire_at
                                             )
        self.deleted = False
 def setUp(self):
     super(BackupORMTest, self).setUp()
     self.context = _prep_conf(utils.utcnow())
     current_time = str(utils.utcnow())
     self.instance_id = 'INSTANCE-' + current_time
     self.backup = models.DBBackup.create(tenant_id=self.context.tenant,
                                          name=BACKUP_NAME,
                                          state=BACKUP_STATE,
                                          instance_id=self.instance_id,
                                          deleted=False,
                                          size=2.0,
                                         location=BACKUP_LOCATION+"/" + BACKUP_FILENAME,
                                          group_id=GROUP_ID,
                                          instType= TYPE)
 def setUp(self):
     super(BackupDeleteTest, self).setUp()
     self.context = _prep_conf(utils.utcnow())
     current_time = str(utils.utcnow())
     self.instance_id = 'INSTANCE-' + current_time