Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(57)  |  Call(32)  |  Derive(4)  |  Import(21)

src/p/r/Products.CMFCore-2.2.8/Products/CMFCore/exportimport/tests/test_typeinfo.py   Products.CMFCore(Download)
from Products.CMFCore.testing import ExportImportZCMLLayer
from Products.CMFCore.tests.base.testcase import WarningInterceptor
from Products.CMFCore.TypesTool import FactoryTypeInformation
from Products.CMFCore.TypesTool import ScriptableTypeInformation
from Products.CMFCore.TypesTool import TypesTool
    def setUp(self):
        self._obj = FactoryTypeInformation('foo_fti')
        self._BODY = _FTI_BODY
        self._trap_warning_output()
 
    def _populate(self, obj):
        obj._setObject('foo_type', FactoryTypeInformation('foo_type'))
 
    def setUp(self):
        self._obj = TypesTool()
        if foo == 1:
            fti = _TI_LIST[0].copy()
            ttool._setObject(fti['id'], FactoryTypeInformation(**fti))
            sti = _TI_LIST[1].copy()
            ttool._setObject(sti['id'], ScriptableTypeInformation(**sti))
        elif foo == 2:
            fti = _TI_LIST_WITH_FILENAME[0].copy()
            ttool._setObject(fti['id'], FactoryTypeInformation(**fti))

src/f/t/ftw.contentpage-1.6.5/ftw/contentpage/tests/test_news_portlets_functional.py   ftw.contentpage(Download)
from plone.portlets.interfaces import IPortletManager
from plone.testing.z2 import Browser
from Products.CMFCore.TypesTool import FactoryTypeInformation
from Products.CMFCore.utils import getToolByName
from Products.Five.browser import BrowserView
    def test_classificationItems(self):
        types_tool = getToolByName(self.portal, 'portal_types')
        types_tool['ClassificationItem'] = FactoryTypeInformation(
            'ClassificationItem')
        transaction.commit()

src/p/r/Products.CMFDefault-2.3.0-beta2/Products/CMFDefault/tests/test_Document.py   Products.CMFDefault(Download)
from Products.CMFCore.tests.base.testcase import TransactionalTest
from Products.CMFCore.tests.base.tidata import FTIDATA_CMF
from Products.CMFCore.TypesTool import FactoryTypeInformation as FTI
from Products.CMFCore.TypesTool import TypesTool
from Products.CMFDefault import utils
        fti = FTIDATA_CMF[0].copy()
        del fti['id']
        ttool._setObject('Document', FTI('Document', **fti))
 
        ps = self.site._setObject('source_html',

src/p/r/Products.CMFDefault-2.3.0-beta2/Products/CMFDefault/tests/test_Discussions.py   Products.CMFDefault(Download)
from Products.CMFCore.tests.base.testcase import SecurityTest
from Products.CMFCore.tests.base.tidata import FTIDATA_DUMMY
from Products.CMFCore.TypesTool import FactoryTypeInformation as FTI
from Products.CMFCore.TypesTool import TypesTool
from Products.CMFDefault.DiscussionTool import DiscussionTool
        del test.allow_discussion
        fti = FTIDATA_DUMMY[0].copy()
        ttool._setObject( 'Dummy Content', FTI(**fti) )
        self.assertRaises(DiscussionNotAllowed, dtool.getDiscussionFor, test)
        assert getattr( test, 'talkback', None ) is None

src/p/r/Products.CMFCore-2.2.8/Products/CMFCore/tests/test_TypesTool.py   Products.CMFCore(Download)
    def test_constructContent_simple_FTI(self):
        from AccessControl.SecurityManagement import newSecurityManager
        from AccessControl.SecurityManager import setSecurityPolicy
        from Products.CMFCore.TypesTool import FactoryTypeInformation as FTI
        from Products.CMFCore.tests.base.dummy import DummyFolder
        tool = self._makeOne().__of__(site)
        fti = FTIDATA_DUMMY[0].copy()
        tool._setObject('Dummy Content', FTI(**fti))
        folder = DummyFolder(id='folder', fake_product=1).__of__(site)
 
    def test_constructContent_FTI_w_wftool_no_workflows(self):
        from AccessControl.SecurityManagement import newSecurityManager
        from AccessControl.SecurityManager import setSecurityPolicy
        from Products.CMFCore.TypesTool import FactoryTypeInformation as FTI
        from Products.CMFCore.tests.base.dummy import DummyFolder
        tool = self._makeOne().__of__(site)
        fti = FTIDATA_DUMMY[0].copy()
        tool._setObject('Dummy Content', FTI(**fti))
        folder = DummyFolder(id='folder', fake_product=1).__of__(site)
        tool.portal_workflow = DummyWorkflowTool()
    def test_constructContent_FTI_w_wftool_w_workflow_no_guard(self):
        from AccessControl.SecurityManagement import newSecurityManager
        from AccessControl.SecurityManager import setSecurityPolicy
        from Products.CMFCore.TypesTool import FactoryTypeInformation as FTI
        from Products.CMFCore.tests.base.dummy import DummyFolder

src/p/r/Products.CMFCore-2.2.8/Products/CMFCore/tests/test_DynamicType.py   Products.CMFCore(Download)
from Products.CMFCore.tests.base.testcase import SecurityRequestTest
from Products.CMFCore.tests.base.tidata import FTIDATA_CMF
from Products.CMFCore.TypesTool import FactoryTypeInformation as FTI
from Products.CMFCore.TypesTool import TypesTool
 
    def setUp(self):
        self.site = DummySite('site')
        self.site._setObject( 'portal_types', TypesTool() )
        fti = FTIDATA_CMF[0].copy()
        self.site.portal_types._setObject( 'Dummy Content 15', FTI(**fti) )
        self.site._setObject( 'portal_url', DummyTool() )
        fti = FTIDATA_CMF[0].copy()
        self.site.portal_types._setObject( 'Dummy Content 15', FTI(**fti) )
        self.site._setObject( 'foo', DummyContent() )
 

Previous  1 | 2