django-dynamic-fixture can also help a lot in this situation: http://paulocheque.github.com/django-dynamic-fixture/
Certainly beats having to futz around with fixtures. On Friday, October 5, 2012 3:49:19 AM UTC+10, Daniele Procida wrote: > > I have started writing my first tests, for a project that has become > pretty large (several thousand lines of source code). > > What needs the most testing - where most of the bugs or incorrect appear > emerge - are the very complex interactions between objects in the system. > > To me, the intuitive way of testing would be this: > > * to set up all the objects, in effect creating a complete working > database > * run all the tests on this database > > That's pretty much the way I test things without automated tests: is the > output of the system, running a huge database of objects, correct? > > However, I keep reading that I should isolate all my tests. So I have had > a go at creating tests that do that, but it can mean setting up a dozen > objects sometimes for a single tiny test, then doing exactly the same thing > with one small difference for another test. > > Often I have to run save() on these objects, because otherwise tests that > depend on many-to-many and other database relations won't work. > > That seems very inefficient, to create a succession of complex and > nearly-identical test conditions for dozens if not hundreds of tests. > > I'd appreciate any advice. > > Daniele > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/JGC6UxYp1qYJ. To post to this group, send email to django-users@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.