当前位置: 首页>>代码示例>>Python>>正文


Python Decision.author方法代码示例

本文整理汇总了Python中publicweb.models.Decision.author方法的典型用法代码示例。如果您正苦于以下问题:Python Decision.author方法的具体用法?Python Decision.author怎么用?Python Decision.author使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在publicweb.models.Decision的用法示例。


在下文中一共展示了Decision.author方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: create_and_return_decision

# 需要导入模块: from publicweb.models import Decision [as 别名]
# 或者: from publicweb.models.Decision import author [as 别名]
 def create_and_return_decision(self, description='Decision Time',
                                status=Decision.PROPOSAL_STATUS, deadline=now().date()):
     decision = Decision(description=description, status=status, organization=self.bettysorg, deadline=deadline)
     decision.author = self.user
     decision.save()
     
     return decision
开发者ID:JayFliz,项目名称:econsensus,代码行数:9,代码来源:decision_test_case.py

示例2: create_and_return_decision

# 需要导入模块: from publicweb.models import Decision [as 别名]
# 或者: from publicweb.models.Decision import author [as 别名]
 def create_and_return_decision(self, description='Decision Time',
                                status=Decision.PROPOSAL_STATUS):
     decision = Decision(description=description, status=status)
     decision.author = self.user
     decision.save()
     
     return decision
开发者ID:harryberto,项目名称:openconsent,代码行数:9,代码来源:decision_test_case.py

示例3: test_emails_dont_contain_escaped_characters

# 需要导入模块: from publicweb.models import Decision [as 别名]
# 或者: from publicweb.models.Decision import author [as 别名]
    def test_emails_dont_contain_escaped_characters(self):
        """
        We want to verify that the emails sent out do not contain
        confusing text like '&amp' instead of '&' or ''&lt'
        instead of '<'
        
        All plaintext emails should be marked 'safe' in the Django template.
        """
        decision = Decision(description='&', status=0)
        decision.author = self.user
        decision.save()

        mymail = OpenConsentEmailMessage('new', decision)
        
        self.assertNotIn('&amp', mymail.subject)
        self.assertNotIn('&amp', mymail.body)

        mymail = OpenConsentEmailMessage('status_change', decision, old_obj=decision)
        
        self.assertNotIn('&amp', mymail.subject)
        self.assertNotIn('&amp', mymail.body)
        
        mymail = OpenConsentEmailMessage('content_change', decision)
        
        self.assertNotIn('&amp', mymail.subject)
        self.assertNotIn('&amp', mymail.body)
开发者ID:amandao,项目名称:openconsent,代码行数:28,代码来源:email_test.py

示例4: test_save_when_no_author

# 需要导入模块: from publicweb.models import Decision [as 别名]
# 或者: from publicweb.models.Decision import author [as 别名]
 def test_save_when_no_author(self):
     decision = Decision(description="Test", status=0)
     decision.author = None
     decision.save()
     decision = Decision.objects.get()
     decision.description = "A change."
     try:
         decision.save()
     except:
         self.fail("Failed to save object.")
开发者ID:samastur,项目名称:openconsent,代码行数:12,代码来源:model_test.py

示例5: test_emails_arent_sent_to_author

# 需要导入模块: from publicweb.models import Decision [as 别名]
# 或者: from publicweb.models.Decision import author [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.author = andy
        decision.save()
        
        #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)
开发者ID:amandao,项目名称:openconsent,代码行数:26,代码来源:email_test.py


注:本文中的publicweb.models.Decision.author方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。