I don't think there's one true way. In other words, the answer is "all of the above," depending on your project and the needs of each individual test.

It also depends on your code. If you've done TDD, and therefore made your code easier to test, you can probably do it the simplest way possible. If you're trying to add coverage after the code is in place, there's often a large amount of "setup" needed due to model relationships, and it's easier to just dump everything into fixtures and write tests to your known data.

There's also a third option, which is to have your tests (or the setUp) dynamically create data for use by the tests. This is really handy for things that are easy to test, but can be too much depending on the design of the code overall.

Shawn

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
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.

Reply via email to