[Zope-dev] Zope Tests: 6 OK

2010-02-28 Thread Zope Tests Summarizer
Summary of messages to the zope-tests list.
Period Sat Feb 27 12:00:00 2010 UTC to Sun Feb 28 12:00:00 2010 UTC.
There were 6 messages: 6 from Zope Tests.


Tests passed OK
---

Subject: OK : Zope-2.10 Python-2.4.6 : Linux
From: Zope Tests
Date: Sat Feb 27 20:36:31 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-February/013647.html

Subject: OK : Zope-2.11 Python-2.4.6 : Linux
From: Zope Tests
Date: Sat Feb 27 20:38:31 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-February/013648.html

Subject: OK : Zope-2.12 Python-2.6.4 : Linux
From: Zope Tests
Date: Sat Feb 27 20:40:31 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-February/013649.html

Subject: OK : Zope-2.12-alltests Python-2.6.4 : Linux
From: Zope Tests
Date: Sat Feb 27 20:42:31 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-February/013650.html

Subject: OK : Zope-trunk Python-2.6.4 : Linux
From: Zope Tests
Date: Sat Feb 27 20:44:31 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-February/013651.html

Subject: OK : Zope-trunk-alltests Python-2.6.4 : Linux
From: Zope Tests
Date: Sat Feb 27 20:46:31 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-February/013652.html

___
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 )


Re: [Zope-dev] Adding W3C validating to zope.testbrowser

2010-02-28 Thread Ross Patterson
Brian Sutherland br...@vanguardistas.net writes:

 On Tue, Feb 23, 2010 at 04:57:02PM +0200, Marius Gedminas wrote:
 On Tue, Feb 23, 2010 at 08:57:09AM -0500, Benji York wrote:
  On Sat, Feb 20, 2010 at 7:53 AM, Ross Patterson m...@rpatterson.net 
  wrote:
   I started a branch for doing W3C HTML validation on responses to
   zope.testbrowser requests:
  

   svn://svn.zope.org/repos/main/zope.testbrowser/branches/rossp-validator
  
   The idea is to be able to flip a switch and run all my functional
   zope.testbrowser tests and see validation failures as test failures.
  
  I'm not keen on this idea.  Validation checking isn't hard to do with
  testbrowser as-is, and doing it on every page load is overkill.  Add to
  that the global nature of the required switch and this really doesn't
  seem like the right approach.
 
 I'd like to chime in and suggest using WSGI to hook up zope.testbrowser
 and zope.app.testing.functional (or a better-designed replacement for
 the latter).  Then you could plug in W3CValidatingMiddleware (if one
 doesn't exist, it should be trivial to write it) between them.

 We use wsgi_intercept to get zope.testbrowser to listen to the other end
 of a WSGI pipe during testing

 http://pypi.python.org/pypi/wsgi_intercept

Yeah, I've looked at wsgi_intercept before.  Good stuff.

 The testbrowser integration we have is far from perfect but was enough
 for is to stop using zope.app.testing.functional

 
 http://svn.zope.org/van.testing/trunk/van/testing/layer.py?rev=105324view=markup

Thanks, I'll check it out.

 It would be pretty simple to have a make_application call that wrapped
 the application in validating middleware depending on an environment
 variable.

Yeah, the more I've thought about it, the more I've been thinking the
right place to do this is in the application's publisher somehow, such
as in a WSGI pipeline.  This would make the validation more widely
usable, specifically to non-developers.  It would me more of a kind of
debug mode.

Lo and behold, it's been done:

http://workaround.org/node/266

Appending the validation errors to the end of the page won't work for
using existing functional tests as a validation testbed because no error is
raised on validation failures and many functional tests ignore the
parts of the returned page they're not interested in.  As such, the
tests won't fail on validation errors.  I can't imagine it would be too
hard to change this behavior.

I'll have to try adding WSGI to one of my typical Zope 2.10, Plone 3
add-on testing buildouts to see how much of a burden this places.

More later,
Ross

___
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 )


Re: [Zope-dev] redirect burps on unicode URLs

2010-02-28 Thread Wichert Akkerman
On 2010-2-26 18:25, Tres Seaver wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Wichert Akkerman wrote:
 On 2/25/10 17:08 , Tres Seaver wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Adam GROSZER wrote:
 Hello,

 Looks like zope.publisher burps on unicode URL which contain non-ascii
 chars. This is from a KGS 3.4 application, but looking at the source
 it still seems to have the same problems.

 opinions?

 ...
   self.request.response.redirect(url)
 File 
 d:\home\.buildout\eggs\zope.publisher-3.4.6-py2.5.egg\zope\publisher\browser.py,
  line
 729, in redirect
   return super(BrowserResponse, self).redirect(location, status)
 File 
 d:\home\.buildout\eggs\zope.publisher-3.4.6-py2.5.egg\zope\publisher\http.py,
  line 882,
 in redirect
   self.setHeader('Location', location)
 File 
 d:\home\.buildout\eggs\zope.publisher-3.4.6-py2.5.egg\zope\publisher\http.py,
  line 676,
 in setHeader
   value = str(value)
 UnicodeEncodeError: 'ascii' codec can't encode character u'\xd6' in 
 position 71: ordinal not in
 range(128)
 Two issues:

 - - Technically there is no such thing as a unicode URL:  URLs are
 always ASCII, with other characters encoded[1].  IRIs and IRLs are
 a different thing altogether.

 I see this as naming confusion. In this day and age every URL is
 effectively an IRI, and every modern browser treats them that way. If
 you look at http://jp.wikipedia.org/ you can see how well that works. I
 do not see why zope.publisher should not be able to support that
 transparently. Other systems such as Routes and repoze.bfg do.

 Browseers *display* what looks like unicode to the user, but they *pass*
 URL-encoded ASCII bytes to the server.

But why can't zope.publisher do that conversion? It don't see the point 
in requiring all the thousands of routines that call those functions to 
do that conversion when zope.publisher can easily do so itself.

Wichert.

-- 
Wichert Akkerman wich...@wiggy.net   It is simple to make things.
http://www.wiggy.net/  It is hard to make things simple.
___
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 )