本文整理汇总了Python中miro.item.Item.watchedTime方法的典型用法代码示例。如果您正苦于以下问题:Python Item.watchedTime方法的具体用法?Python Item.watchedTime怎么用?Python Item.watchedTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类miro.item.Item
的用法示例。
在下文中一共展示了Item.watchedTime方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_expired_view_3
# 需要导入模块: from miro.item import Item [as 别名]
# 或者: from miro.item.Item import watchedTime [as 别名]
def test_expired_view_3(self):
f3 = Feed(u"http://example.com/3")
i5 = Item(fp_values_for_url(u"http://example.com/3/item1"), feed_id=f3.id)
i6 = Item(fp_values_for_url(u"http://example.com/3/item2"), feed_id=f3.id)
f3.set_expiration(u"feed", 24)
i5.watchedTime = datetime.now() - timedelta(days=3)
i6.watchedTime = datetime.now() - timedelta(hours=12)
for obj in (f3, i5, i6):
obj.signal_change()
self.assertEquals(list(f3.expiring_items()), [i5])
示例2: test_watched_time_reset
# 需要导入模块: from miro.item import Item [as 别名]
# 或者: from miro.item.Item import watchedTime [as 别名]
def test_watched_time_reset(self):
feed = Feed(u'http://example.com/1')
item = Item(fp_values_for_url(u'http://example.com/1/item1'),
feed_id=feed.id)
item.watchedTime = datetime.now()
item.expire()
self.assertEquals(item.watchedTime, None)
示例3: test_expired_view_2
# 需要导入模块: from miro.item import Item [as 别名]
# 或者: from miro.item.Item import watchedTime [as 别名]
def test_expired_view_2(self):
f2 = Feed(u"http://example.com/2")
i3 = Item(fp_values_for_url(u"http://example.com/2/item1"), feed_id=f2.id)
i4 = Item(fp_values_for_url(u"http://example.com/2/item2"), feed_id=f2.id)
f2.set_expiration(u"system", 0)
# system default is 6 days as set in setUp, so i3 should expire,
# but i4 should not.
i3.watchedTime = datetime.now() - timedelta(days=12)
i4.watchedTime = datetime.now() - timedelta(days=3)
for obj in (f2, i3, i4):
obj.signal_change()
self.assertEquals(list(f2.expiring_items()), [i3])