Use plone.app.testing in test_tool.

svn path=/plone.app.discussion/trunk/; revision=48903
This commit is contained in:
Timo Stollenwerk 2011-04-16 09:30:11 +00:00
parent fc59094cb2
commit 1682c89745

View File

@ -1,19 +1,20 @@
import unittest import unittest2 as unittest
from zope.component import queryUtility, createObject from zope.component import queryUtility, 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.discussion.testing import PLONE_APP_DISCUSSION_INTEGRATION_TESTING
from plone.app.discussion.interfaces import ICommentingTool, IConversation from plone.app.discussion.interfaces import ICommentingTool, IConversation
class ToolTest(PloneTestCase): class ToolTest(unittest.TestCase):
layer = DiscussionLayer layer = PLONE_APP_DISCUSSION_INTEGRATION_TESTING
def afterSetUp(self): def setUp(self):
# First we need to create some content. self.portal = self.layer['portal']
self.loginAsPortalOwner() setRoles(self.portal, TEST_USER_ID, ['Manager'])
self.portal.invokeFactory(id='doc1', self.portal.invokeFactory(id='doc1',
title='Document 1', title='Document 1',
type_name='Document') type_name='Document')