Use plone.app.testing in test_controlpanel.

svn path=/plone.app.discussion/trunk/; revision=48900
This commit is contained in:
Timo Stollenwerk 2011-04-16 09:26:20 +00:00
parent f8019b0c10
commit c4e69627b3

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import unittest import unittest2 as unittest
from zope.component import getMultiAdapter from zope.component import getMultiAdapter
from zope.component import queryUtility from zope.component import queryUtility
@ -8,19 +8,20 @@ from plone.registry import Registry
from plone.registry.interfaces import IRegistry from plone.registry.interfaces import IRegistry
from Products.CMFCore.utils import getToolByName from Products.CMFCore.utils import getToolByName
from Products.PloneTestCase.ptc import PloneTestCase
from plone.app.testing import TEST_USER_ID, setRoles
from plone.app.discussion.interfaces import IDiscussionSettings from plone.app.discussion.interfaces import IDiscussionSettings
from plone.app.discussion.tests.layer import DiscussionLayer from plone.app.discussion.testing import PLONE_APP_DISCUSSION_INTEGRATION_TESTING
class RegistryTest(PloneTestCase): class RegistryTest(unittest.TestCase):
layer = DiscussionLayer layer = PLONE_APP_DISCUSSION_INTEGRATION_TESTING
def afterSetUp(self): def setUp(self):
self.loginAsPortalOwner() self.portal = self.layer['portal']
# Set up the registry setRoles(self.portal, TEST_USER_ID, ['Manager'])
self.registry = Registry() self.registry = Registry()
self.registry.registerInterface(IDiscussionSettings) self.registry.registerInterface(IDiscussionSettings)
@ -99,13 +100,13 @@ class RegistryTest(PloneTestCase):
# 'IDiscussionSettings.user_notification_enabled'], False) # 'IDiscussionSettings.user_notification_enabled'], False)
class ConfigurationChangedSubscriberTest(PloneTestCase): class ConfigurationChangedSubscriberTest(unittest.TestCase):
layer = DiscussionLayer layer = PLONE_APP_DISCUSSION_INTEGRATION_TESTING
def afterSetUp(self): def setUp(self):
self.loginAsPortalOwner() self.portal = self.layer['portal']
# Set up the registry setRoles(self.portal, TEST_USER_ID, ['Manager'])
registry = queryUtility(IRegistry) registry = queryUtility(IRegistry)
self.settings = registry.forInterface(IDiscussionSettings, check=False) self.settings = registry.forInterface(IDiscussionSettings, check=False)