Hi Chris,

First of all, I never had much luck writing reproducible tests for
Django models with the fixture system that comes built into Django as
I never got consistent results and found the XML a pain to maintain. I
came across Fixture - http://code.google.com/p/fixture/ We have this
running with our Django installation for all our unittests and it
works a treat. There are some examples of unittests in the source for
that.

I've used that in an open source project called Django audit to test
some model related bits and pieces, but I wouldn't necessarily attest
to their being "good tests" as it's a work in progress. Have a look at
https://launchpad.net/django-audit/ in the tests section.

For good unittesting in general in a Django type manner (but not
specifically model related) have a look at 
http://pypi.python.org/pypi/twod.wsgi/

Hope this helps, Euan

On May 6, 9:23 am, Chris Withers <ch...@simplistix.co.uk> wrote:
> Hi All,
>
> Where can I find good examples of django unit tests?
>
> I currently just want to test my models and some helper functions, but
> they will do a .save() on a bunch of model instances.
>
> Any help gratefully recieved!
>
> Chris
>
> --
> 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 
> athttp://groups.google.com/group/django-users?hl=en.

-- 
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