本文整理汇总了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")
示例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)
示例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)