TurboGears Identity testing

cookiesIf you have an web application which requires users to login, it can be harder to test because that means your application isn’t stateless any more, so you have to setup and maintain a user’s state. And that usually means you need to mock up a browser interface that that understands and remembers cookies.

Luckily with Python this isn’t hard to do. You can use existing tools like Twil, or PBP, or the underling tools like Mechanize, ClientCookie, and ClientForm.

Or you could just do the simplist thing that could work, like Nadav Samet.

Nadav wrote a BrowserSession class in less than 20 lines of Python, which lets you have different browser session objects logged in as different users. It’s easy to use, easy to understand, and it works. Testing your TurboGears applications has never been easier.
Thanks Nadav!

0 Responses to “TurboGears Identity testing”


  1. No Comments

Leave a Reply