當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。