本文整理匯總了Python中publicweb.models.Feedback.decision方法的典型用法代碼示例。如果您正苦於以下問題:Python Feedback.decision方法的具體用法?Python Feedback.decision怎麽用?Python Feedback.decision使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類publicweb.models.Feedback
的用法示例。
在下文中一共展示了Feedback.decision方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_feedback_linebreaks
# 需要導入模塊: from publicweb.models import Feedback [as 別名]
# 或者: from publicweb.models.Feedback import decision [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 decision [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 decision [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)