[Plone-IT] Plone & mechanize (REPOST)

luigi scarso luigi.scarso a gmail.com
Ven 23 Gen 2009 16:42:20 UTC


2009/1/23 Fabrizio Reale <fabrizio.reale a redomino.com>

> Ciao,
> Scusa, ma non avevo visto questo:
>
> > > $>$PLONEROOT/Plone-3.1.7/zeocluster/parts/client2/bin/zopectl run
> test.py
>
> Ti manca il commit.
>
si si infatti cercavo qualcosa di questo genere; in fondo sto agendo su un
(ZO)DB .
Ho aggiunto appr._p_jar.sync()

##/Plone-3.1.7/zeocluster/parts/client2/bin/zopectl run test.py
## test.py
##
import AccessControl.SecurityManagement
from pprint import pprint as pprint
from Products.CMFPlone.utils import _createObjectByType
from Testing import makerequest
import transaction
##
## zope site is app
##
##
appr = makerequest.makerequest(app)
admin = appr.acl_users.getUser('f')
AccessControl.SecurityManagement.newSecurityManager(None,admin)
pprint( "BEFORE" )
pprint( appr.Plone.Members.testuser.items() )
folder = appr.Plone.Members.testuser.invokeFactory("Folder",
id="sample02",title="sample02")
appr.Plone.Members.testuser.sample02.reindexObject()
transaction.commit()
appr._p_jar.sync()
pprint( "AFTER" )
pprint( appr.Plone.Members.testuser.items() )

$>Plone-3.1.7/zeocluster/parts/client2/bin/zopectl run test.py

'BEFORE'
[('sample01', <ATFolder at /Plone/Members/testuser/sample01>)]
'AFTER'
[('sample01', <ATFolder at /Plone/Members/testuser/sample01>),
 ('sample02', <ATFolder at /Plone/Members/testuser/sample02>)]

*ed anche* via web

http://plone.org/documentation/tutorial/best-practices/debugging-plone
http://plone.org/documentation/manual/upgrade-guide/version/2.5-3.0/products/transaction_get-syntax-change


ora faccio alcuni test
(ovvero alla prossima [?])


-- 
luigi
-------------- parte successiva --------------
Un allegato HTML  stato rimosso...
URL: <http://lists.plone.org/pipermail/plone-plone-it/attachments/20090123/922bda37/attachment.html>
-------------- parte successiva --------------
Un allegato non testuale  stato rimosso....
Nome:        330.gif
Tipo:        image/gif
Dimensione:  96 bytes
Descrizione: non disponibile
URL:         <http://lists.plone.org/pipermail/plone-plone-it/attachments/20090123/922bda37/attachment-0002.gif>


Maggiori informazioni sulla lista Plone-IT