From a4011ce4143379484ce0f1d1a04c3d1082087278 Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Fri, 3 Sep 2010 21:23:44 +0000 Subject: [PATCH] Fix the comment view test. svn path=/plone.app.discussion/trunk/; revision=39629 --- plone/app/discussion/tests/test_comment.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plone/app/discussion/tests/test_comment.py b/plone/app/discussion/tests/test_comment.py index ea4bab1..0c18eb0 100644 --- a/plone/app/discussion/tests/test_comment.py +++ b/plone/app/discussion/tests/test_comment.py @@ -10,6 +10,8 @@ from plone.app.discussion.tests.layer import DiscussionLayer from plone.app.discussion.interfaces import IComment, IConversation, IReplies +from plone.app.discussion.browser.comment import View + class CommentTest(PloneTestCase): @@ -125,8 +127,11 @@ class CommentTest(PloneTestCase): self.failUnless(getMultiAdapter((comment, self.app.REQUEST), name='view')) - # TODO: is this correct? Redirect ist 301 - self.assertEquals(200, self.app.REQUEST.response.getStatus()) + # make sure the HTTP redirect (status code 302) works when a comment + # is called directly + view = View(comment, self.app.REQUEST) + View.__call__(view) + self.assertEquals(self.app.REQUEST.response.status, 302) class RepliesTest(PloneTestCase):