> I'm writing a controller test to verify that my /insert page correctly
> inserts a row into a table.  After the test fails or passes, I want to
> wipe that row out of the table.
>
> I know I could manually delete the row in my teardown method, but I
> would prefer not to, because there are lots of tests, each doing lots
> of changes.
>
> So how do I run my controller test in a larger transaction and then
> roll it all back?
>
> I tried putting database.rollback_all() in my teardown, but I think
> that when I run testutil.call, that causes the system to commit the
> change anyway.

If I were you, I would change my testing strategy. I found it to be
much better to test with a test db and make all sorts of mess in that
and not touching my "real" db. You can create/delete/insert/update/etc
in the test db as you like, there is no danger in messing it up. This
will also encourage you to test more and test more crazy scenarios
because you won't be afraid to mess up the "real" db.

Cheers,
Daniel

-- 
Psss, psss, put it down! - http://www.cafepress.com/putitdown

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to