Ian Bicking: the old part of his blog

Re: Best of the web app test frameworks?

When I wrote my webapp framework last year, I too found that Zope testing was inadequate, and I still do. I ended up writing my own app end-to-end (I could not bear without an autoreload feature for the source code, and all Zope3 facilities for fast development were broken, couldn't use webdav to upload files, had to restart server on every change, there was no way I was going to work like that), and using mechanize for testing it. IMO best testing for the web should be done from a browser's perspective to really be effective. I have found so many problems that would have slipped by without my tests.

One useful idea that I introduced in my app was to return custom meta fields in the head, that reflect some of the internal state of the server app, for example, the currently logged in user, and a return status string. These only show up when the app is in debug mode, and the tests assert that the return statii are what is expected.

Another idea was to add extra test resources/pages in debug mode. For example, when my app sends email to other users, well, in debug mode, it doesn't really send, rather, it puts the emails in a DB table (only the last email for each user) and then the tests can recuperate the last email sent for a particular user, whose contents it then validates. I can parse the email to get some links with tokens, etc. Just trying to do as close to the real processes as possible.

cheers,

Comment on Best of the web app test frameworks?
by Martin Blais

Comments:

paste.fixture does both of these:

# Ian Bicking