I'm trying to implement automatic purging on a content type and, according to plone.cachepurging documentation, I added the following to the configure.zcml
file:
<class class="collective.polls.content.poll.Poll">
<implements interface="z3c.caching.interfaces.IPurgeable" />
</class>
now I'm adding a test for this feature but the result is weird:
def test_purging(self):
from zope.component import eventtesting
from zope.event import notify
from zope.lifecycleevent import ObjectModifiedEvent
eventtesting.setUp()
notify(ObjectModifiedEvent(self.poll))
events = eventtesting.getEvents()
results in the following:
(Pdb) pp events
[<z3c.caching.purge.Purge object at 0x7f094165e110>,
<zope.lifecycleevent.ObjectModifiedEvent object at 0x7f0941d88690>,
<z3c.caching.purge.Purge object at 0x7f0941657d50>]
does anybody know why the Purge
event is fired twice? is that normal?