本文整理汇总了Python中Products.CMFCore.tests.base.testcase.PlacelessSetup类的典型用法代码示例。如果您正苦于以下问题:Python PlacelessSetup类的具体用法?Python PlacelessSetup怎么用?Python PlacelessSetup使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PlacelessSetup类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
def setUp(self):
import Products.CMFCore.exportimport
PlacelessSetup.setUp(self)
BaseRegistryTests.setUp(self)
zcml.load_config('meta.zcml', Products.Five)
zcml.load_config('configure.zcml', Products.CMFCore.exportimport)
示例2: setUp
def setUp(self):
PlacelessSetup.setUp(self)
RequestTest.setUp(self)
zcml.load_config('meta.zcml', Products.Five)
zcml.load_config('permissions.zcml', Products.Five)
zcml.load_config('configure.zcml', Products.GenericSetup)
zcml.load_config('configure.zcml', Products.CMFCore)
zcml.load_config('configure.zcml', Products.DCWorkflow)
zcml.load_string(_TRAVERSE_ZCML)
try:
newSecurityManager(None, UnrestrictedUser('manager', '', ['Manager'], []))
factory = self.root.manage_addProduct['CMFDefault'].addConfiguredSite
factory('cmf', 'CMFDefault:default', snapshot=False)
self.site = self.root.cmf
self.site.invokeFactory('File', id='file')
self.site.portal_workflow.doActionFor(self.site.file, 'publish')
self.site.invokeFactory('Image', id='image')
self.site.portal_workflow.doActionFor(self.site.image, 'publish')
self.site.invokeFactory('Folder', id='subfolder')
self.subfolder = self.site.subfolder
self.workflow = self.site.portal_workflow
transaction.savepoint(optimistic=True) # Make sure we have _p_jars
except:
self.tearDown()
raise
示例3: setUp
def setUp( self ):
PlacelessSetup.setUp(self)
SecurityRequestTest.setUp( self )
self._trap_warning_output()
zcml.load_config('meta.zcml', Products.Five)
zcml.load_config('configure.zcml', Products.GenericSetup)
zcml.load_config('configure.zcml', Products.CMFCore)
示例4: setUp
def setUp(self):
PlacelessSetup.setUp(self)
RequestTest.setUp(self)
zcml.load_config('meta.zcml', Products.Five)
zcml.load_config('permissions.zcml', Products.Five)
zcml.load_config('configure.zcml', Products.GenericSetup)
zcml.load_config('configure.zcml', Products.CMFCore)
zcml.load_config('configure.zcml', Products.DCWorkflow)
zcml.load_string(_TRAVERSE_ZCML)
try:
factory = self.root.manage_addProduct['CMFDefault'].addConfiguredSite
factory('cmf', 'CMFDefault:default', snapshot=False)
self.portal = self.root.cmf
# Become a Manager
self.uf = self.portal.acl_users
self.uf.userFolderAddUser('manager', '', ['Manager'], [])
self.login('manager')
# Make a document
self.discussion = self.portal.portal_discussion
self.portal.invokeFactory('Document', id='doc')
self.discussion.overrideDiscussionFor(self.portal.doc, 1)
# Publish it
self.workflow = self.portal.portal_workflow
self.workflow.doActionFor(self.portal.doc, 'publish')
except:
self.tearDown()
raise
示例5: setUp
def setUp(self):
import Products.CMFCore
import Products.Five
from Products.Five import zcml
import Products.GenericSetup
PlacelessSetup.setUp(self)
RequestTest.setUp(self)
zcml.load_config("meta.zcml", Products.Five)
zcml.load_config("permissions.zcml", Products.Five)
zcml.load_config("configure.zcml", Products.GenericSetup)
zcml.load_config("configure.zcml", Products.CMFCore)
zcml.load_config("configure.zcml", Products.DCWorkflow)
factory = self.root.manage_addProduct["CMFDefault"].addConfiguredSite
factory("site", "CMFDefault:default", snapshot=False)
self.site = self.root.site
self.site._setObject("topic", Topic("topic"))
self.topic = self.site.topic
self.topic.addCriterion("modified", "Friendly Date Criterion")
self.topic.addCriterion("portal_type", "String Criterion")
type_crit = self.topic.getCriterion("portal_type")
type_crit.edit(value="Dummy Content")
self.criterion = self.topic.getCriterion("modified")
self.now = DateTime()
for i in self.day_diffs:
dummy_id = "dummy%i" % i
self.site._setObject(dummy_id, DummyContent(id=dummy_id, catalog=1))
dummy_ob = getattr(self.site, dummy_id)
dummy_ob.modified_date = self.now + i
dummy_ob.reindexObject()
示例6: setUp
def setUp(self):
import Products.CMFCore
import Products.Five
from Products.Five import zcml
import Products.GenericSetup
PlacelessSetup.setUp(self)
RequestTest.setUp(self)
zcml.load_config('meta.zcml', Products.Five)
zcml.load_config('permissions.zcml', Products.Five)
zcml.load_config('configure.zcml', Products.GenericSetup)
zcml.load_config('configure.zcml', Products.CMFCore)
zcml.load_config('configure.zcml', Products.DCWorkflow)
factory = self.root.manage_addProduct['CMFDefault'].addConfiguredSite
factory('site', 'CMFDefault:default', snapshot=False)
self.site = self.root.site
self.site._setObject( 'topic', Topic('topic') )
self.topic = self.site.topic
self.topic.addCriterion('modified', 'Friendly Date Criterion')
self.topic.addCriterion('portal_type', 'String Criterion')
type_crit = self.topic.getCriterion('portal_type')
type_crit.edit(value='Dummy Content')
self.criterion = self.topic.getCriterion('modified')
self.now = DateTime()
self._old_as_of = _replace_DC__as_of(lambda: self.now)
for i in self.day_diffs:
dummy_id = 'dummy%i' % i
self.site._setObject( dummy_id, DummyContent( id=dummy_id
, catalog=1
) )
dummy_ob = getattr(self.site, dummy_id)
dummy_ob.modified_date = self.now + i
dummy_ob.reindexObject()
示例7: setUp
def setUp(self):
import Products.GenericSetup.MailHost
PlacelessSetup.setUp(self)
BaseRegistryTests.setUp(self)
zcml.load_config('meta.zcml', Products.Five)
zcml.load_config('configure.zcml', Products.GenericSetup.MailHost)
示例8: tearDown
def tearDown(self):
from AccessControl.SecurityManagement import noSecurityManager
if self._finally is not None:
self._finally()
noSecurityManager()
PlacelessSetup.tearDown(self)
示例9: setUp
def setUp(self):
PlacelessSetup.setUp(self)
SecurityRequestTest.setUp(self)
zcml.load_config('meta.zcml', Products.Five)
zcml.load_config('permissions.zcml', Products.Five)
zcml.load_config('configure.zcml', Products.GenericSetup)
zcml.load_config('configure.zcml', Products.CMFCore)
zcml.load_config('configure.zcml', Products.DCWorkflow)
示例10: setUp
def setUp(self):
from zope.component import provideHandler
from zope.app.event.interfaces import IObjectEvent
from Products.CMFCore.interfaces import ICookieCrumbler
from Products.CMFCore.CookieCrumbler import handleCookieCrumblerEvent
PlacelessSetup.setUp(self)
self._finally = None
provideHandler(handleCookieCrumblerEvent,
adapts=(ICookieCrumbler, IObjectEvent))
示例11: setUp
def setUp(self):
import Products.CMFCore
PlacelessSetup.setUp(self)
TransactionalTest.setUp(self)
zcml.load_config('meta.zcml', Products.Five)
zcml.load_config('permissions.zcml', Products.Five)
zcml.load_config('configure.zcml', Products.CMFCore)
zcml.load_string(_TRAVERSE_ZCML)
root = self.root
root._setObject('portal', DummyContent('portal', 'url_portal'))
portal = self.portal = root.portal
portal.portal_membership = DummyMembershipTool()
self.folder = DummyContent('foo', 'url_foo')
self.object = DummyContent('bar', 'url_bar')
示例12: setUp
def setUp(self):
PlacelessSetup.setUp(self)
BaseRegistryTests.setUp(self)
zcml.load_config('meta.zcml', Products.Five)
zcml.load_config('permissions.zcml', Products.Five)
zcml.load_config('configure.zcml', Products.CMFCore)
示例13: tearDown
def tearDown(self):
RequestTest.tearDown(self)
PlacelessSetup.tearDown(self)
示例14: tearDown
def tearDown(self):
noSecurityManager()
RequestTest.tearDown(self)
PlacelessSetup.tearDown(self)
示例15: tearDown
def tearDown(self):
SecurityRequestTest.tearDown(self)
PlacelessSetup.tearDown(self)