1
我有一个定制产品,其中有许多敏捷类型,其中有几个被建立处理程序用来创建网站结构。此作品,未经测试之外的任何问题,但测试中它一直未能:对测试过程中敏捷类型的ComponentLookupError
Traceback (most recent call last):
[snip]
File "/opt/ctcc_plone/src/ctcc.model/ctcc/model/setuphandlers.py", line 52, in setupStructure
random = createSiteFolder(portal, 'ctcc.model.servicefolder', 'Randomisation', 'random')
File "/opt/ctcc_plone/src/ctcc.model/ctcc/model/setuphandlers.py", line 35, in createSiteFolder
return createContentInContainer(context, type, title=title, id=id)
File "/opt/ctcc_plone/eggs/plone.dexterity-1.1-py2.7.egg/plone/dexterity/utils.py", line 166, in createContentInContainer
content = createContent(portal_type, **kw)
File "/opt/ctcc_plone/eggs/plone.dexterity-1.1-py2.7.egg/plone/dexterity/utils.py", line 112, in createContent
fti = getUtility(IDexterityFTI, name=portal_type)
File "/opt/ctcc_plone/eggs/zope.component-3.9.5-py2.7.egg/zope/component/_api.py", line 169, in getUtility
raise ComponentLookupError(interface, name)
ComponentLookupError: (<InterfaceClass plone.dexterity.interfaces.IDexterityFTI>, 'ctcc.model.servicefolder')
我保证包的配置文件在安装过程中输入:
class CTCCModelSandboxLayer(PloneSandboxLayer):
defaultBases = (PLONE_FIXTURE,)
def setUpZope(self, app, configurationContext):
import ctcc.model
self.loadZCML(package=ctcc.model)
def setUpPloneSite(self, portal):
self.applyProfile(portal, 'ctcc.model:default')
虽然他们列为安装要求在包的设置中,我还尝试了plone.app.dexterity
以及quickInstallProduct
上的明确applyProfile
,但由于某种原因,敏捷FTI在被调用时似乎没有注册。
我使用的Plone 4.1,敏捷1.1和4.2 plone.app.testing
_Cannot_获取语法突出显示以处理代码段,对不起。 – 2012-07-31 06:16:33
修正了对于亚,请参阅[我如何格式化我的代码块?](http://meta.stackexchange.com/q/22186) – 2012-07-31 09:27:23
啊,我使用的是标签而不是lang引用,欢呼声。 – 2012-07-31 09:43:05