On Sat, Feb 6, 2010 at 1:25 AM, Malcolm Box <malcolm....@gmail.com> wrote:

>> From there, I have only been able to reduce test time down from hours
>> to minutes. Tests ought to run in seconds - so fast that you can run
>> them after every few edits - TDD.
>
> Totally agree, and what I'm looking to make Django do.  At the moment a full
> test run for my stuff takes about 5 minutes - not impossibly long, but long
> enough for a task switch to something else.

You won't get any disagreement out of me on this point. We have made
lots of speed improvements since the test framework was first
introduced. However, despite these changes, Django's tests still take
too long to run. They *should* be much faster.

>> One
>> of Django's particular sins is it drags all the data from your JSON
>> fixtures into fully resolved models.py objects before saving them.
>> This runs tons of Python code for no reason - you are not testing your
>> models' validations or save routines. The test runner should instead
>> push the JSON contents directly into the database as bulk import
>> statements.
>>
>
>  Hmm, that sounds like something that could be fixed.  Does anyone know if
> this is on the Django dev's radar and/or if someone's working on it?

I'm not aware of any specific test-speedup efforts at the moment.

In this general vein, I've had some vague thoughts about adding a
"Bulk create" method to the ORM for a while. In the "i've got an itch"
category, I've got a use case at work where I need to do this, and I
end up reverting to raw SQL to do it. This works, but given that it's
a pretty banal use case, it would be nice to have ORM support. More
broadly, all the m2m operations (which are currently multiple single
inserts/deletes) could benefit from this sort of API, as could fixture
loading.

However, the severity of my itch hasn't yet become enough to actually
make time on my schedule to write code. If you want to make this your
pet project, you certainly have my blessing.

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 django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to