本文整理汇总了Python中publicweb.models.Decision.watchers方法的典型用法代码示例。如果您正苦于以下问题:Python Decision.watchers方法的具体用法?Python Decision.watchers怎么用?Python Decision.watchers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类publicweb.models.Decision
的用法示例。
在下文中一共展示了Decision.watchers方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_emails_arent_sent_to_author
# 需要导入模块: from publicweb.models import Decision [as 别名]
# 或者: from publicweb.models.Decision import watchers [as 别名]
def test_emails_arent_sent_to_author(self):
"""
We want to make sure that when a user creates or changes an
item they are not sent an email. The email goes to those
that do not already know the item has changed!
"""
andy = User.objects.create_user("Andy", "[email protected]", password='password')
billy = User.objects.create_user("Billy", "[email protected]", password='password')
chris = User.objects.create_user("Chris", "[email protected]", password='password')
decision = Decision(description='Test', status=0)
decision.save(andy)
#billy decides he wants to watch...
decision.watchers = [billy]
#andy changes the content
mymail = OpenConsentEmailMessage('content_change', decision)
#only watchers get mail, not the author
self.assertNotIn(andy.email, mymail.to)
self.assertIn(billy.email, mymail.to)
self.assertNotIn(chris.email, mymail.to)