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


Python Feedback.author方法代码示例

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


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

示例1: test_feedback_linebreaks

# 需要导入模块: from publicweb.models import Feedback [as 别名]
# 或者: from publicweb.models.Feedback import author [as 别名]
 def test_feedback_linebreaks(self):
     decision = self.make_decision(description="Lorem")
     feedback = Feedback(description="text\ntext")
     feedback.decision = decision
     feedback.author = self.user
     feedback.save()
     path = reverse("publicweb_feedback_detail", args=[feedback.id])
     response = self.client.get(path)
     self.assertContains(response, "text<br />text", 1, msg_prefix="Failed to line break text")
开发者ID:foobacca,项目名称:econsensus,代码行数:11,代码来源:html_test.py

示例2: test_feedback_author_shown

# 需要导入模块: from publicweb.models import Feedback [as 别名]
# 或者: from publicweb.models.Feedback import author [as 别名]
 def test_feedback_author_shown(self):
     decision = self.make_decision(description="Lorem Ipsum")
     feedback = Feedback(description="Dolor sit")
     feedback.author = self.user
     feedback.decision = decision
     feedback.save()
     
     self.user = self.login('charlie')        
     path = reverse('publicweb_item_detail', args=[decision.id])
     response = self.client.get(path)
     betty = User.objects.get(username='betty')
     self.assertContains(response, betty.first_name)
开发者ID:Administr8Me,项目名称:econsensus,代码行数:14,代码来源:html_test.py

示例3: test_feedback_author_shown

# 需要导入模块: from publicweb.models import Feedback [as 别名]
# 或者: from publicweb.models.Feedback import author [as 别名]
 def test_feedback_author_shown(self):
     self.user = self.login('Barry')
     decision = Decision(description="Lorem Ipsum")
     decision.save()
     feedback = Feedback(description="Dolor sit")
     feedback.author = self.user
     feedback.decision = decision
     feedback.save()
     
     self.user = self.login('Adam')        
     path = reverse('publicweb_item_detail', args=[decision.id])
     response = self.client.get(path)
     barry = User.objects.get(username='Barry')
     self.assertContains(response, barry.username)
开发者ID:samastur,项目名称:openconsent,代码行数:16,代码来源:html_test.py


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