本文整理汇总了Python中models.SyndicatedPost.put方法的典型用法代码示例。如果您正苦于以下问题:Python SyndicatedPost.put方法的具体用法?Python SyndicatedPost.put怎么用?Python SyndicatedPost.put使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.SyndicatedPost
的用法示例。
在下文中一共展示了SyndicatedPost.put方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_refetch_unchanged_syndication
# 需要导入模块: from models import SyndicatedPost [as 别名]
# 或者: from models.SyndicatedPost import put [as 别名]
def test_refetch_unchanged_syndication(self):
"""We should preserve unchanged SyndicatedPosts during refetches."""
synd = SyndicatedPost(parent=self.source.key,
original='http://author/permalink',
syndication='https://fa.ke/post/url')
synd.put()
self.expect_requests_get('http://author', """
<html class="h-feed">
<div class="h-entry">
<a class="u-url" href="/permalink"></a>
<a class="u-syndication" href="https://fa.ke/post/url"></a>
</div>
</html>""")
self.mox.ReplayAll()
refetch(self.source)
self.assert_entities_equal([synd], list(SyndicatedPost.query()))
示例2: test_refetch_blank_syndication
# 需要导入模块: from models import SyndicatedPost [as 别名]
# 或者: from models.SyndicatedPost import put [as 别名]
def test_refetch_blank_syndication(self):
"""We should preserve blank SyndicatedPosts during refetches."""
blank = SyndicatedPost(parent=self.source.key,
original='http://author/permalink',
syndication=None)
blank.put()
self.expect_requests_get('http://author', """
<html class="h-feed">
<div class="h-entry">
<a class="u-url" href="/permalink"></a>
</div>
</html>""")
self.expect_requests_get('http://author/permalink', """
<html class="h-entry">
<a class="u-url" href="/permalink"></a>
</html>""")
self.mox.ReplayAll()
self.assert_equals({}, refetch(self.source))
self.assert_syndicated_posts(('http://author/permalink', None))