Ticket #11110: next_redirect_via_comment_preview.diff
File next_redirect_via_comment_preview.diff, 1.7 KB (added by , 15 years ago) |
---|
-
django/contrib/comments/views/comments.py
80 80 template_list, { 81 81 "comment" : form.data.get("comment", ""), 82 82 "form" : form, 83 "next": next ,83 "next": next or data.get("next", None), 84 84 }, 85 85 RequestContext(request, {}) 86 86 ) -
tests/regressiontests/comment_tests/tests/comment_view_tests.py
219 219 location = response["Location"] 220 220 match = re.search(r"^http://testserver/somewhere/else/\?foo=bar&c=\d+$", location) 221 221 self.failUnless(match != None, "Unexpected redirect location: %s" % location) 222 223 No newline at end of file 222 223 def testCommentPreviewWithNext(self): 224 """ 225 The preview view needs to handle the `next` key being passed in (#11110) 226 """ 227 a = Article.objects.get(pk=1) 228 data = self.getValidData(a) 229 data["preview"] = "Preview" 230 data["next"] = "/somewhere/else/" 231 response = self.client.post("/post/", data) 232 self.assertTemplateUsed(response, "comments/preview.html") 233 self.assertEqual(response.status_code, 200) 234 self.assertEqual(response.context[0]["next"], data["next"])