當前位置: 首頁>>代碼示例>>Python>>正文


Python testcase.PlacelessSetup類代碼示例

本文整理匯總了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)
開發者ID:goschtl,項目名稱:zope,代碼行數:7,代碼來源:test_properties.py

示例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
開發者ID:goschtl,項目名稱:zope,代碼行數:25,代碼來源:test_Image.py

示例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)
開發者ID:goschtl,項目名稱:zope,代碼行數:7,代碼來源:test_Portal.py

示例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
開發者ID:goschtl,項目名稱:zope,代碼行數:27,代碼來源:test_DiscussionReply.py

示例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()
開發者ID:wpjunior,項目名稱:proled,代碼行數:32,代碼來源:test_DateC.py

示例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()
開發者ID:goschtl,項目名稱:zope,代碼行數:34,代碼來源:test_DateC.py

示例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)
開發者ID:goschtl,項目名稱:zope,代碼行數:7,代碼來源:test_mailhost.py

示例8: tearDown

    def tearDown(self):
        from AccessControl.SecurityManagement import noSecurityManager

        if self._finally is not None:
            self._finally()

        noSecurityManager()
        PlacelessSetup.tearDown(self)
開發者ID:goschtl,項目名稱:zope,代碼行數:8,代碼來源:test_CookieCrumbler.py

示例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)
開發者ID:goschtl,項目名稱:zope,代碼行數:8,代碼來源:test_Portal.py

示例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))
開發者ID:goschtl,項目名稱:zope,代碼行數:11,代碼來源:test_CookieCrumbler.py

示例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')
開發者ID:goschtl,項目名稱:zope,代碼行數:15,代碼來源:test_ActionInformation.py

示例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)
開發者ID:goschtl,項目名稱:zope,代碼行數:6,代碼來源:test_typeinfo.py

示例13: tearDown

 def tearDown(self):
     RequestTest.tearDown(self)
     PlacelessSetup.tearDown(self)
開發者ID:goschtl,項目名稱:zope,代碼行數:3,代碼來源:test_DateC.py

示例14: tearDown

 def tearDown(self):
     noSecurityManager()
     RequestTest.tearDown(self)
     PlacelessSetup.tearDown(self)
開發者ID:goschtl,項目名稱:zope,代碼行數:4,代碼來源:test_DiscussionReply.py

示例15: tearDown

 def tearDown(self):
     SecurityRequestTest.tearDown(self)
     PlacelessSetup.tearDown(self)
開發者ID:goschtl,項目名稱:zope,代碼行數:3,代碼來源:test_Portal.py


注:本文中的Products.CMFCore.tests.base.testcase.PlacelessSetup類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。