Op 18-01-13 16:26, Tres Seaver schreef:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 01/18/2013 08:58 AM, Maurits van Rees wrote:
Op 16-01-13 18:47, Tres Seaver schreef:
[3]    FAILED  winbot / z3c.ptcompat_py_265_32
https://mail.zope.org/pipermail/zope-tests/2013-January/071440.html



Same error related to the recent zope.pagetemplates changes.

This is a test that passes with standard zope.pagetemplates, but fails
  in combination with Chameleon.  It is in a recursion test that has
been added in zope.pagetemplate 4.0.0.

I have now added a bin/testcompat script in the zope.pagetemplates
buildout to test with z3c.pt(compat) plus Chameleon.

The expected output for this test is:

<!-- See https://bugs.launchpad.net/zope.pagetemplate/+bug/732972 -->
<ul> <li>root</li> <li> <ul> <li>first</li> </ul> </li> <li> <ul>
<li>second</li> </ul> </li> </ul>

The real output is:

<!-- See https://bugs.launchpad.net/zope.pagetemplate/+bug/732972 -->
<ul> <li>root</li> <li> <ul> <li>first</li>

</ul> </li> <li> <ul> <li>second</li>

</ul> </li> </ul>

The difference is that the two inner '</ul>' get an extra line before
  them with a single space character.

I have tried a few changes in the test template to see if that would
result in the output html being the same with and without Chameleon,
but that did not work.

Possibly this needs a change not in zope.pagetemplate but in Chameleon
  or one of the other packages.

Or use ElementTree to normalize the XHTML before testing (since the
whitespace diffreences are semantically irrelevant).

I did it in a crude way in zope.pagetemplate:

+        # crude way of normalizing whitespace
+        expect = expect.replace(' ', '').replace('\n\n', '\n')
+        out = out.replace(' ', '').replace('\n\n', '\n')
         util.check_html(expect, out)

That works.

For the buildbot test to pass, a zope.pagetemplate 4.0.1 release would need to be made.


--
Maurits van Rees: http://maurits.vanrees.org/
Zest Software: http://zestsoftware.nl

_______________________________________________
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )

Reply via email to