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")
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='******') self.assertContains(response, betty.first_name)
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")
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='******') self.assertContains(response, barry.username)