def test_expiration(self):
now = datetime.now(tz=tz.tzutc())
three_months = now + timedelta(90)
two_months = now + timedelta(60)
def i(d):
return instance(LaunchTime=d)
fdata = {
'type': 'value',
'key': 'LaunchTime',
'op': 'less-than',
'value_type': 'expiration',
'value': 61}
self.assertFilter(fdata, i(three_months), False)
self.assertFilter(fdata, i(two_months), True)
self.assertFilter(fdata, i(now), True)
self.assertFilter(fdata, i(now.isoformat()), True)
评论列表
文章目录