What should be unit tested in models.py? I assume the storing of data and
retrieving of data from the database does not need to be tested, as I
further assume django has a full set of tests for those operations.

I can see testing these parts of models.py

* All custom methods

* Labels for all fields
something like
def test_first_name_label(self):
        author=Author.objects.get(id=1)
        field_label = author._meta.get_field('first_name').verbose_name
        self.assertEquals(field_label,'first name')

* Field attributes (eg length of CharField)? Is this really necessary, as I
would again assume django covers this in their unit tests?

Anything else that I am missing?

Thanks!

Mark

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEqej2P0_sZt2j06nf0OnOL%2BE%3DuVa1Cs0BOFmTx8vjQm6-io2Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to