On Tue, Jan 24, 2012 at 2:22 AM, Anssi Kääriäinen <anssi.kaariai...@thl.fi> wrote: > On Jan 24, 3:07 am, Daniel Moisset <dmois...@machinalis.com> wrote: >> [1] The idea is loading fixtures once per TestCase instead of once per >> test method, and use DB rollbacks after each test to return the DB to >> the after-fixtures-just-loaded state. > > So, the idea is to do the following for each TestCase: > > begin > load fixtures > savepoint s1 > do test 1 > rollback to savepoint 1 > do test 2 > rollback to savepoint 1 > ... > # all methods ran > rollback > > I think that should work. It would be great to write this in a way > that just checks if the connection supports savepoints. If not, then > run the tests in the old-fashioned way, if yes, do the above trick.
OK, I can change that... there are a few other drawbacks: my current code does not support multi-db setups, And I don't feel experienced enough on that scenario to feel sure how to proceed in that case or what is safe to do. Anyway what I can do is: if connection support savepoints AND is single db, follow this approach Regards, D. -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.