Use plone.app.testing in test_indexers.

svn path=/plone.app.discussion/trunk/; revision=48905
This commit is contained in:
Timo Stollenwerk 2011-04-16 09:35:34 +00:00
parent 85126e9109
commit 216e95aa27

View File

@ -1,15 +1,18 @@
"""Test for the plone.app.discussion indexers """Test for the plone.app.discussion indexers
""" """
import unittest import unittest2 as unittest
from datetime import datetime from datetime import datetime
from DateTime import DateTime from DateTime import DateTime
from zope.component import createObject from zope.component import createObject
from Products.PloneTestCase.ptc import PloneTestCase from plone.app.testing import TEST_USER_ID, setRoles
from plone.app.discussion.tests.layer import DiscussionLayer 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 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 [...]""" sed diam voluptua. At [...]"""
class ConversationIndexersTest(PloneTestCase): class ConversationIndexersTest(unittest.TestCase):
"""Conversation Indexer Tests """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', self.portal.invokeFactory(id='doc1',
title='Document 1', title='Document 1',
type_name='Document') type_name='Document')
@ -100,13 +104,15 @@ class ConversationIndexersTest(PloneTestCase):
# DelegatingIndexerFactory)) # 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', self.portal.invokeFactory(id='doc1',
title='Document 1', title='Document 1',
type_name='Document') type_name='Document')