本文整理汇总了Python中tests.factories.UserFactory.comments_viewed_timestamp方法的典型用法代码示例。如果您正苦于以下问题:Python UserFactory.comments_viewed_timestamp方法的具体用法?Python UserFactory.comments_viewed_timestamp怎么用?Python UserFactory.comments_viewed_timestamp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tests.factories.UserFactory
的用法示例。
在下文中一共展示了UserFactory.comments_viewed_timestamp方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_update_comments_viewed_timestamp_none
# 需要导入模块: from tests.factories import UserFactory [as 别名]
# 或者: from tests.factories.UserFactory import comments_viewed_timestamp [as 别名]
def test_update_comments_viewed_timestamp_none(self):
user = UserFactory()
user.comments_viewed_timestamp = {}
user.save()
update_comments_viewed_timestamp()
user.reload()
assert_equal(user.comments_viewed_timestamp, {})
示例2: test_update_comments_viewed_timestamp
# 需要导入模块: from tests.factories import UserFactory [as 别名]
# 或者: from tests.factories.UserFactory import comments_viewed_timestamp [as 别名]
def test_update_comments_viewed_timestamp(self):
user = UserFactory()
timestamp = datetime.utcnow().replace(microsecond=0)
user.comments_viewed_timestamp = {'abc123': timestamp}
user.save()
update_comments_viewed_timestamp()
user.reload()
assert_equal(user.comments_viewed_timestamp, {'abc123': {'node': timestamp}})