Hi,

I need to use a second Plone Site on a FunctionalTestCase. I'm trying to do as follows:

def setupNoticias(self):
    from fixtures.noticias import noticias
    self.setRoles(['Manager','Owner'])
    zope_root = self.portal.aq_inner.aq_parent
zope_root.manage_addProduct['CMFPlone'].addPloneSite('noticias', create_userfolder=1, snapshot=0, profile_id='CMFPlone:plone')
    portal_noticias = getattr(zope_root, 'noticias')

The traceback is:

File "/Users/dirceu/devel/zope298/Products/SebraeConfigurador/tests/test_associacao.py", line 75, in Products.SebraeConfigurador.tests.test_associacao.test_associacao_noticias
Failed example:
    setupNoticias(self)
Exception raised:
    Traceback (most recent call last):
File "/opt/zope298/lib/python/zope/testing/doctest.py", line 1348, in __run
        compileflags, 1) in test.globs
File "<doctest Products.SebraeConfigurador.tests.test_associacao.test_associacao_noticias[1]>", line 1, in ?
        setupNoticias(self)
File "/Users/dirceu/devel/zope298/Products/SebraeConfigurador/tests/utils.py", line 61, in setupNoticias

zope_root.manage_addProduct['CMFPlone'].addPloneSite('noticias', create_userfolder=1, snapshot=0, profile_id='CMFPlone:plone') File "/Users/dirceu/devel/zope298/Products/CMFPlone/factory.py", line 52, in addPloneSite
        setup_tool.runAllImportSteps()
File "/Users/dirceu/devel/zope298/Products/GenericSetup/tool.py", line 252, in runAllImportSteps return self._runImportStepsFromContext(context, purge_old=purge_old) File "/Users/dirceu/devel/zope298/Products/GenericSetup/tool.py", line 766, in _runImportStepsFromContext
        message = self._doRunImportStep(step, context)
File "/Users/dirceu/devel/zope298/Products/GenericSetup/tool.py", line 732, in _doRunImportStep
        return handler(context)
File "/Users/dirceu/devel/zope298/Products/CMFPlone/setuphandlers.py", line 202, in importVarious
        gen.installProducts(site)
File "/Users/dirceu/devel/zope298/Products/CMFPlone/setuphandlers.py", line 28, in installProducts
        qi.installProduct('PlonePAS', locked=1)
File "/Users/dirceu/devel/zope298/Products/CMFQuickInstallerTool/QuickInstallerTool.py", line 333, in installProduct
        res=install(portal)
File "/opt/zope298/lib/python/Products/ExternalMethod/ExternalMethod.py", line 225, in __call__
        try: return f(*args, **kw)
File "/Users/dirceu/devel/zope298/Products/PlonePAS/Extensions/Install.py", line 837, in install
        setupTools(portal, out)
File "/Users/dirceu/devel/zope298/Products/PlonePAS/Extensions/Install.py", line 396, in setupTools
        migratePloneTool(portal, out)
File "/Users/dirceu/devel/zope298/Products/PlonePAS/Extensions/Install.py", line 407, in migratePloneTool
        portal.manage_delObjects(['plone_utils'])
File "/Users/dirceu/devel/zope298/Products/CMFPlone/Portal.py", line 143, in manage_delObjects
        raise Unauthorized, (
    Unauthorized: Do not have permissions to remove this object

I'm using Zope 2.9.8 and Plone 2.5.3. How can I use a second plone site on a PloneTestCase test?

Thanks,
--
Dirceu Pereira Tiegs
Weimar Consultoria

Hospedagem Plone, Zope e Python
http://www.pytown.com

_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers

Reply via email to