本文整理汇总了Python中zds.tutorialv2.factories.PublishableContentFactory.sha_beta方法的典型用法代码示例。如果您正苦于以下问题:Python PublishableContentFactory.sha_beta方法的具体用法?Python PublishableContentFactory.sha_beta怎么用?Python PublishableContentFactory.sha_beta使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类zds.tutorialv2.factories.PublishableContentFactory
的用法示例。
在下文中一共展示了PublishableContentFactory.sha_beta方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_beta_articles
# 需要导入模块: from zds.tutorialv2.factories import PublishableContentFactory [as 别名]
# 或者: from zds.tutorialv2.factories.PublishableContentFactory import sha_beta [as 别名]
def test_get_beta_articles(self):
# Start with 0
self.assertEqual(len(self.user1.get_beta_articles()), 0)
# Create article !
article = PublishableContentFactory(type='ARTICLE')
article.authors.add(self.user1.user)
article.sha_beta = 'whatever'
article.save()
# Should be 1
articles = self.user1.get_beta_articles()
self.assertEqual(len(articles), 1)
self.assertEqual(article, articles[0])
示例2: test_get_beta_tutos
# 需要导入模块: from zds.tutorialv2.factories import PublishableContentFactory [as 别名]
# 或者: from zds.tutorialv2.factories.PublishableContentFactory import sha_beta [as 别名]
def test_get_beta_tutos(self):
# Start with 0
self.assertEqual(len(self.user1.get_beta_tutos()), 0)
# Create Tuto !
betatetuto = PublishableContentFactory(type='TUTORIAL')
betatetuto.authors.add(self.user1.user)
betatetuto.gallery = GalleryFactory()
betatetuto.sha_beta = 'whatever'
betatetuto.save()
# Should be 1
betatetutos = self.user1.get_beta_tutos()
self.assertEqual(len(betatetutos), 1)
self.assertEqual(betatetuto, betatetutos[0])