From c4e69627b33e1a4be2535835278e7065235835cc Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Sat, 16 Apr 2011 09:26:20 +0000 Subject: [PATCH] Use plone.app.testing in test_controlpanel. svn path=/plone.app.discussion/trunk/; revision=48900 --- .../app/discussion/tests/test_controlpanel.py | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/plone/app/discussion/tests/test_controlpanel.py b/plone/app/discussion/tests/test_controlpanel.py index a2e9d99..69c14e0 100644 --- a/plone/app/discussion/tests/test_controlpanel.py +++ b/plone/app/discussion/tests/test_controlpanel.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -import unittest +import unittest2 as unittest from zope.component import getMultiAdapter from zope.component import queryUtility @@ -8,19 +8,20 @@ from plone.registry import Registry from plone.registry.interfaces import IRegistry 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.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): - self.loginAsPortalOwner() - # Set up the registry + def setUp(self): + self.portal = self.layer['portal'] + setRoles(self.portal, TEST_USER_ID, ['Manager']) self.registry = Registry() self.registry.registerInterface(IDiscussionSettings) @@ -99,13 +100,13 @@ class RegistryTest(PloneTestCase): # 'IDiscussionSettings.user_notification_enabled'], False) -class ConfigurationChangedSubscriberTest(PloneTestCase): +class ConfigurationChangedSubscriberTest(unittest.TestCase): - layer = DiscussionLayer + layer = PLONE_APP_DISCUSSION_INTEGRATION_TESTING - def afterSetUp(self): - self.loginAsPortalOwner() - # Set up the registry + def setUp(self): + self.portal = self.layer['portal'] + setRoles(self.portal, TEST_USER_ID, ['Manager']) registry = queryUtility(IRegistry) self.settings = registry.forInterface(IDiscussionSettings, check=False)