A critique of cgi.escape
Gabriel G
gabrielg_laburando at yahoo.com.ar
Tue Sep 26 18:49:17 EDT 2006
At Tuesday 26/9/2006 12:53, Jon Ribbens wrote:
> > BTW, I am curious about how you do unit testing. The example that I used
> > in my summary is a very common pattern but would break in cgi.escape
> > changed it's semantics. What do you do instead?
>
>To be honest I'm not sure what *sort* of code people test this way. It
>just doesn't seem appropriate at all for web page generating code. Web
>pages need to be manually viewed in web browsers, and validated, and
>checked for accessibility. Checking they're equal to a particular
>string just seems bizarre (and where does that string come from
>anyway?)
By example, I do not validate a "page". I validate that all methods
that make up pieces of a page, build them the way they should - these
are our "unit tests". Then, it's up to the templating library to join
all the pieces into the final html page.
I validated the original html against the corresponding dtd some time
ago (using the w3c validator), and ocasionally when things "looks
wrong" on a browser, but most of the time the html generated pages
are not validated nor checked as a whole.
What you describe are another kind of tests, and really should not
depend on the details of cgi.escape - as the usability test of an MP3
player does not care about some transitor's hFE used inside...
Gabriel Genellina
Softlab SRL
__________________________________________________
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya!
http://www.yahoo.com.ar/respuestas
More information about the Python-list
mailing list