On Aug 7, 2011, at 07:00 , CMF tests summarizer wrote:
> 
> [1]    UNKNOWN FAILED (failures=3, errors=4) : CMF-trunk Zope-trunk 
> Python-2.6.6 : Linux
>       https://mail.zope.org/pipermail/cmf-tests/2011-August/015089.html

I have tried to pinpoint the reason for some of these test failures. Two of 
these tests are for the CMF Discussions functionality:

Failure in test test_deleteReplies 
(Products.CMFDefault.tests.test_Discussions.DiscussionTests)
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/unittest.py", line 279, in run
    testMethod()
  File 
"/usr/local/py26/cmf_trunk/src/Products.CMFDefault/Products/CMFDefault/tests/test_Discussions.py",
 line 301, in test_deleteReplies
    self.assertEqual(len(ctool), 4)
  File "/usr/local/lib/python2.6/unittest.py", line 350, in failUnlessEqual
    (msg or '%r != %r' % (first, second))
AssertionError: 6 != 4

Failure in test test_itemCataloguing 
(Products.CMFDefault.tests.test_Discussions.DiscussionTests)
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/unittest.py", line 279, in run
    testMethod()
  File 
"/usr/local/py26/cmf_trunk/src/Products.CMFDefault/Products/CMFDefault/tests/test_Discussions.py",
 line 212, in test_itemCataloguing
    % reply.getId()))
  File "/usr/local/lib/python2.6/unittest.py", line 325, in failUnless
    if not expr: raise self.failureException, msg
AssertionError

Those tests started failing after the following Zope-checkin:

http://svn.zope.org/?rev=122213&view=rev

What ends up happening in both cases is discussion replies ending up with a 
wrong idea about their physical path. Normally, they all should have a physical 
path that points to the "talkback" discussion container object attached to the 
original content item that houses the discussion, like so:

/path/to/content/talkback/12345
/path/to/content/talkback/12346
/path/to/content/talkback/12347
…

All of a sudden a "reply to a reply" thinks it is stored not in the content 
object's "talkback", but in a new "talkback" attached to the reply the user has 
replied to:

/path/to/content/talkback/12345
/path/to/content/talkback/12345/talkback/12346
/path/to/content/talkback/12345/talkback/12346/talkback/12347

The problem appears in CMFDefault.DiscussionItem.createReply on line 251, where 
the newly created discussion reply is aqcuisition-wrapped in the talkback 
object:

        item = DiscussionItem( id, title=title, description=title )
        self._container[id] = item
        item = item.__of__(self)

After the wrapping, the discussion item has the wrong path. Even though "self", 
the "talkback" object, has the correct path when calling getPhysicalPath on it. 
I can't see anything overly stupid in the DiscussionItem code, so there has to 
be an issue with that Zope getPhysicalPath change. Reverting that one change in 
the current Zope trunk fixes the tests.

jens


_______________________________________________
Zope-CMF maillist  -  Zope-CMF@zope.org
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests

Reply via email to