当前位置: 首页>>代码示例>>Python>>正文


Python atsitetestcase.ATSiteTestCase类代码示例

本文整理汇总了Python中Products.Archetypes.tests.atsitetestcase.ATSiteTestCase的典型用法代码示例。如果您正苦于以下问题:Python ATSiteTestCase类的具体用法?Python ATSiteTestCase怎么用?Python ATSiteTestCase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ATSiteTestCase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: tearDown

 def tearDown(self):
     ATSiteTestCase.tearDown(self)
     del ComplexType.schema['richtextfield'].index
     try:
         del ComplexType.schema['richtextfield'].index_method
     except (AttributeError, KeyError):
         pass
开发者ID:CGTIC,项目名称:Plone_SP,代码行数:7,代码来源:test_extensions_utils.py

示例2: afterSetUp

 def afterSetUp(self):
     self.setRoles(['Manager'])
     ATSiteTestCase.afterSetUp(self)
     self._dummy = mkDummyInContext(Dummy, oid='dummy', context=self.portal,
                                    schema=schema)
     txt_file.seek(0)
     img_file.seek(0)
开发者ID:adamcheasley,项目名称:Products.Archetypes,代码行数:7,代码来源:test_fields.py

示例3: afterSetUp

    def afterSetUp(self):
        ATSiteTestCase.afterSetUp(self)
        self.setRoles(['Manager'])
        self.portal.invokeFactory('Folder', 'test_folder_')
        self.folder = self.portal.test_folder_
        t = self._type
        self.portal.portal_workflow.setChainForPortalTypes((t,), ('plone_workflow',))
        self.inst = inst = makeContent(self.folder, portal_type=t, id=t)
        self.object_id = t
        self.attrs = [f.getName() for f in inst.Schema().fields()
                      if isinstance(f.getStorage(), AttributeStorage)]

        self.check_attrs = """\
        content = getattr(context, '%(object_id)s')
        for attr in %(attrs)s:
            print getattr(content, attr, None)
        """ % {'object_id': self.object_id,
               'attrs': self.attrs}

        self.check_methods = """\
        content = getattr(context, '%(object_id)s')
        for meth in %(methods)s:
            print getattr(content, meth)()
        """ % {'object_id': self.object_id,
               'methods': ['foo']}
        self.logout()
开发者ID:CGTIC,项目名称:Plone_SP,代码行数:26,代码来源:test_security.py

示例4: afterSetUp

 def afterSetUp(self):
     ATSiteTestCase.afterSetUp(self)
     # install AT within portal
     self.login()
     self.demo_instances = []
     for t in self.demo_types:
         inst = makeContent(self.folder, portal_type=t, id=t)
         self.demo_instances.append(inst)
开发者ID:CGTIC,项目名称:Plone_SP,代码行数:8,代码来源:test_cmfessentials.py

示例5: afterSetUp

 def afterSetUp(self):
     ATSiteTestCase.afterSetUp(self)
     self._dummy = mkDummyInContext(klass=Dummy, oid='dummy',
                                    context=self.portal, schema=schema)
     # to enable overrideDiscussionFor
     self.setRoles(['Manager'])
     self.makeDummy()
     addMetadataTo(self._dummy)
开发者ID:MrTango,项目名称:Products.Archetypes,代码行数:8,代码来源:test_metadata.py

示例6: afterSetUp

 def afterSetUp(self):
     ATSiteTestCase.afterSetUp(self)
     self.attool = self.portal.archetype_tool
     # Calling mkDummyInContext adds content, but also registers
     # our classes and adds a copy of the schema.
     self._dummy1 = mkDummyInContext(
         Dummy1, oid='dummy1', context=self.portal, schema=schema1)
     self._dummy2 = mkDummyInContext(
         Dummy2, oid='dummy2', context=self.portal, schema=schema2)
开发者ID:seanupton,项目名称:Products.Archetypes,代码行数:9,代码来源:test_update_schema.py

示例7: afterSetUp

 def afterSetUp(self):
     ATSiteTestCase.afterSetUp(self)
     self.pt = self.portal.portal_transforms
     valid_tags = copy.deepcopy(VALID_TAGS)
     valid_tags['script'] = 1
     nasty_tags = copy.deepcopy(NASTY_TAGS)
     del nasty_tags['script']
     self.pt.unregisterTransform('safe_html')
     self.pt.registerTransform(SafeHTML(nasty_tags=nasty_tags,
         valid_tags=valid_tags))
开发者ID:prakharjoshi,项目名称:Products.PortalTransforms,代码行数:10,代码来源:test_transforms.py

示例8: afterSetUp

    def afterSetUp(self):
        ATSiteTestCase.afterSetUp(self)
        atapi.registerType(Dummy, 'Archetypes')
        content_types, constructors, ftis = atapi.process_types(atapi.listTypes(), PKG_NAME)
        portal = self.portal
        dummy = Dummy(oid='dummy')
        # put dummy in context of portal
        dummy = dummy.__of__(portal)
        portal.dummy = dummy

        dummy.initializeArchetype()
        self._dummy = dummy
开发者ID:CGTIC,项目名称:Plone_SP,代码行数:12,代码来源:test_baseschema.py

示例9: afterSetUp

    def afterSetUp(self):
        ATSiteTestCase.afterSetUp(self)
        registerType(Dummy, "Archetypes")
        content_types, constructors, ftis = process_types(listTypes(), PKG_NAME)
        portal = self.portal
        dummy = Dummy(oid="dummy")
        # put dummy in context of portal
        dummy = dummy.__of__(portal)
        portal.dummy = dummy

        dummy.initializeArchetype()
        self._dummy = dummy
开发者ID:urska19,项目名称:Plone-test,代码行数:12,代码来源:test_languagevocabulary.py

示例10: afterSetUp

    def afterSetUp(self):
        ATSiteTestCase.afterSetUp(self)
        self.setRoles(['Manager'])

        imgpath = os.path.join(PACKAGE_HOME, os.pardir, 'tool.gif')
        self._image = open(imgpath).read()

        portal = self.portal

        portal.invokeFactory('DDocument', id='document')
        doc = portal.document
        doc.setBody('testdata', mimetype='text/x-rst')
        doc.setImage(self._image, mimetype='image/gif')
开发者ID:seanupton,项目名称:Products.Archetypes,代码行数:13,代码来源:test_copying.py

示例11: afterSetUp

 def afterSetUp(self):
     ATSiteTestCase.afterSetUp(self)
     # install AT within portal
     self.login()
     self.demo_instances = []
     for t in self.demo_types:
         # XXX: Fails with "Unauthorized" exception from
         #      CMFDefault/DiscussionTool.py:84, in overrideDiscussionFor
         #
         #      Note that BaseObject.initializeArchetype has a bare except
         #      that prints out the error instead of letting it through, so
         #      that there is no exception when running the test.
         inst = makeContent(self.folder, portal_type=t, id=t)
         self.demo_instances.append(inst)
开发者ID:dtgit,项目名称:dtedu,代码行数:14,代码来源:test_cmfessentials.py

示例12: afterSetUp

    def afterSetUp(self):
        ATSiteTestCase.afterSetUp(self)
        self._dummy = mkDummyInContext(klass=Dummy, oid='dummy',
                                       context=self.portal, schema=schema)
        gen_class(DummyFolder)

        # to enable overrideDiscussionFor
        self.setRoles(['Manager'])

        parent = mkDummyInContext(klass=DummyFolder, oid='parent',
                                  context=self.portal, schema=None)
        self._parent = parent

        # create dummy
        self._dummy = mkDummyInContext(klass=Dummy, oid='dummy',
                                       context=parent, schema=None)
开发者ID:seanupton,项目名称:Products.Archetypes,代码行数:16,代码来源:test_metadata.py

示例13: afterSetUp

 def afterSetUp(self):
     ATSiteTestCase.afterSetUp(self)
     self.engine = self.portal.portal_transforms
开发者ID:MarkTang,项目名称:erp5,代码行数:3,代码来源:test_graph.py

示例14: afterSetUp

 def afterSetUp(self):
     ATSiteTestCase.afterSetUp(self)
     self.registry = self.portal.mimetypes_registry
开发者ID:dtgit,项目名称:dtedu,代码行数:3,代码来源:test_magic.py

示例15: afterSetUp

 def afterSetUp(self):
     ATSiteTestCase.afterSetUp(self)
     self._dummy = mkDummyInContext(Dummy, oid='dummy', context=self.portal,
                                   schema=schema)
开发者ID:rristow,项目名称:Products.Archetypes,代码行数:4,代码来源:test_baseobject.py


注:本文中的Products.Archetypes.tests.atsitetestcase.ATSiteTestCase类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。