canonical-django team mailing list archive
-
canonical-django team
-
Mailing list archive
-
Message #00026
Re: Django testing best practices
Hi, James.
On Sun, Jun 13, 2010 at 2:01 PM, James Westby
<james.westby@xxxxxxxxxxxxx> wrote:
>
> We weren't sure about appropriate tests for the basics of models, such
> as creating an object and checking that it has an attribute that was
> defined via a field. This is hampered as in my testing some things about
> the field, such as limits on the length of a string don't seem to be
> enforced in a test environment (with the sqlite3 backend).
>
I don't usually test things that are covered by the Django test suite.
So I wouldn't test model validation again, since Django itself has
tests for this. Others don't like to trust the framework this way, so
it's a personal choice. Were it me, I would just test the behavior of
the model that is unique to my application.
Cheers,
deryck
--
Deryck Hodge
https://launchpad.net/~deryck
http://www.devurandom.org/
Follow ups
References