Answering my own questions, for posterity & the curious. On Dec 29, 2007 5:05 PM, Ken Kuhlman <[EMAIL PROTECTED]> wrote:
> Is it possible/reasonable to test form submission using testutil? I was > thinking that I could just emulate the form submission by passing the > appropriate args on the url as query parameters with > testutil.create_request . . but that approach doesn't replicate the > problem I'm seeing with my code when I hit the page with a form submit from > a browser. > My working theory on why I couldn't reproduce the problem with testutil is that the transaction wasn't getting committed (it was a DB integrity violation). It would probably have been possible to track that down, but I feel like I'm on more solid ground with twill or paste.fixture and have decided to pursue that route [1]. > Should I be using twill or paste.fixture instead? If so, which is > superior? From some light blog reading, it looks to me like twill has the > edge, but I'd be interested in the opinion of someone with more experience > in these two tools. > Here's a brief comparison of twill & paste.fixture based on my current understanding: twill: + good documentation (there's even a short book) + wide adoption. 78k vs 2k hits in a simplistic googlefight [2]. I've encountered examples of using twill with CherryPy, Turbogears, Django, Zope, Pylons, etc. during my wanderings. + twill-sh can be used as a test recorder. There's also a maxq extension, but I'm not sure what it's current state is. paste.fixture: + access to wsgi environment makes testing controller results possible. + nice pythonic API. + pylons uses it, and tg2 will be based on pylons. Other notes: * Several times using twill, I've felt that the exceptions haven't been as informative as they could be. I haven't used Paste enough to draw a comparison there. * I've hacked up twill to support access to the wsgi environment using wsgi_intercept [3], but Titus naturally wants me to clean it up before accepting it. I plan on working on it more this weekend. thanks, > -Ken > -Ken [1] Another reason for going with a 'form aware' test framework is the ability to test identity-controlled apps. [2] http://www.googlefight.com/index.php?lang=en_GB&word1=python+twill&word2=python+paste.fixture [3] http://lists.idyll.org/pipermail/twill/2008-January/000835.html --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~---

