Ticket #16456: comments-preview-request-object.diff
File comments-preview-request-object.diff, 1.5 KB (added by , 13 years ago) |
---|
-
django/contrib/comments/views/comments.py
97 97 "comment" : form.data.get("comment", ""), 98 98 "form" : form, 99 99 "next": next, 100 "object" : target, 100 101 }, 101 102 RequestContext(request, {}) 102 103 ) -
tests/regressiontests/comment_tests/tests/comment_view_tests.py
68 68 response = self.client.post("/post/", data) 69 69 self.assertEqual(response.status_code, 200) 70 70 self.assertTemplateUsed(response, "comments/preview.html") 71 self.assertEqual(response.context["object"], a) 71 72 73 def testCommentErrorContext(self): 74 a = Article.objects.get(pk=1) 75 data = self.getValidData(a) 76 del data["comment"] 77 response = self.client.post("/post/", data) 78 self.assertEqual(response.status_code, 200) 79 self.assertTemplateUsed(response, "comments/preview.html") 80 self.assertEqual(response.context["object"], a) 81 72 82 def testHashTampering(self): 73 83 a = Article.objects.get(pk=1) 74 84 data = self.getValidData(a)