From 216e95aa27b9cdde39b1afb8f3e121fac955aadd Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Sat, 16 Apr 2011 09:35:34 +0000 Subject: [PATCH] Use plone.app.testing in test_indexers. svn path=/plone.app.discussion/trunk/; revision=48905 --- plone/app/discussion/tests/test_indexers.py | 32 ++++++++++++--------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/plone/app/discussion/tests/test_indexers.py b/plone/app/discussion/tests/test_indexers.py index 5b33164..bee1c26 100644 --- a/plone/app/discussion/tests/test_indexers.py +++ b/plone/app/discussion/tests/test_indexers.py @@ -1,15 +1,18 @@ """Test for the plone.app.discussion indexers """ -import unittest +import unittest2 as unittest from datetime import datetime from DateTime import DateTime from zope.component import createObject -from Products.PloneTestCase.ptc import PloneTestCase -from plone.app.discussion.tests.layer import DiscussionLayer +from plone.app.testing import TEST_USER_ID, setRoles +from plone.app.testing import logout, login + +from plone.app.discussion.testing import \ + PLONE_APP_DISCUSSION_INTEGRATION_TESTING from plone.app.discussion.interfaces import IConversation @@ -28,15 +31,16 @@ diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At [...]""" -class ConversationIndexersTest(PloneTestCase): +class ConversationIndexersTest(unittest.TestCase): """Conversation Indexer Tests """ - layer = DiscussionLayer + layer = PLONE_APP_DISCUSSION_INTEGRATION_TESTING + + def setUp(self): + self.portal = self.layer['portal'] + setRoles(self.portal, TEST_USER_ID, ['Manager']) - def afterSetUp(self): - # First we need to create some content. - self.loginAsPortalOwner() self.portal.invokeFactory(id='doc1', title='Document 1', type_name='Document') @@ -100,13 +104,15 @@ class ConversationIndexersTest(PloneTestCase): # DelegatingIndexerFactory)) -class CommentIndexersTest(PloneTestCase): +class CommentIndexersTest(unittest.TestCase): - layer = DiscussionLayer + layer = PLONE_APP_DISCUSSION_INTEGRATION_TESTING + + + def setUp(self): + self.portal = self.layer['portal'] + setRoles(self.portal, TEST_USER_ID, ['Manager']) - def afterSetUp(self): - # First we need to create some content. - self.loginAsPortalOwner() self.portal.invokeFactory(id='doc1', title='Document 1', type_name='Document')