On Sat, Jan 16, 2010 at 1:38 AM, apramanik <[email protected]> wrote:
> I turned autocommit on for our Django project and our unittests fail
> unless we put "transaction.rollback" in our tearDown. Any idea why?
> After fixing that I also noticed that our unittests are *much* slower.
> Is it because they're mainly doing deletes and writes (we also load in
> fixtures via YAML) and they don't get accumulated before being written
> to disk? Thanks!

Without having any details about your unit tests, it's impossible to
say for certain what is causing your slowdowns. However, a likely
cause is the difference between  django.test.TestCase and
django.test.TransactionTestCase.

django.test.TestCase uses transactions internally to speed up the
testing process. However, if your tests rely on the use of
transactions, you may experience problems. See the docs on TestCase
and TransactionTestCase [1] for more details.

[1] http://docs.djangoproject.com/en/1.1/topics/testing/#testcase

Yours,
Russ Magee %-)
-- 
You received this message because you are subscribed to the Google Groups 
"Django users" 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/django-users?hl=en.


Reply via email to