On Nov 25, 11:18 pm, Tim Chase <[EMAIL PROTECTED]> wrote: > > Check out django.contrib.auth.tests.views.py. > > Is there some master index of documentation for "if you want to > test X, see Y.py or http://Z for an example of how to do it"? > where X is any of a number of Django features such as models, > views, templates, middleware, filters, template-tags, forms, > database-configurations, custom field-types, etc? > > I've read through > > http://docs.djangoproject.com/en/dev/topics/testing/?from=olddocs > > and there are some good specifics here (I'd expect that several > of the "see http://Z" links would point here). However, it would > be nice to have a "testing cookbook" that would attack the topic > by "thing you want to test" (perhaps with both unittest and > doctest examples). > > Most of my learning-to-test-my-Django-app has happened through > trial and error, so any sort of "you want to test X, see Y" would > be helpful. > > -tim
Russ, thanks again for the tip (combination of setUp trickery and custom template loader). That would in fact be even better because it means you don't rely on "os" and on the file system, which is good if you're dealing with AppEngine I suppose. Tim, I couldn't agree more. There is a big lack of practical examples in the documentation. Most of what I learned was from django's test suite itself or from popular third party apps. Eric Holscher recently started a discussion on his blog [1] about this, and I tried to reply to it in my blog [2]. Let's keep the discussion going (I mean, not necessarily in this thread, but on blogs and forums maybe)! It'd be great to improve the doc. It would open the doors of testing to the community and everyone would eventually benefit from it! Russ and Malcolm (if you're still here :) ), I'd love to hear your view on this, as I know testing is very important in your eyes. Regards, Julien [1] http://ericholscher.com/blog/2008/nov/13/stubbing-out-tests-django/ [2] http://www.julienphalip.com/blog/2008/11/15/misconceptions-about-testing-and-what-we-should-do/ --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---