Gene Campbell wrote:
> Thanks for the insight!  Do you write tests to check for constraints
> that are optional in definitions, for example?
> 
> address4    = models.CharField(max_length=45, null=True, blank=True)
> 
> could be written as
> 
> address4    = models.CharField(max_length=45)
> 
> Were is the most reasonable place to test this is correct (not regressing)

I'm not sure.  I'm distraught over having validations in two places the 
model and forms that "feed" that model.  And form_from_model or whatever 
it is called is never what I want.   I tend to test the forms as I tend 
to manipulate models through forms and the forms support much richer 
validations than FooFields do.

Blank is an admin thing and I typically don't test those.  Testing 
Nullable field(s) would be data point(s) in creation/save test.

> What about uniqueness, and composite field uniqueness?
>     #  unique_together = (("field1", "field2","field3"),)
> 
> I'm thinking it would make sense to try to
> create 2 of an object and save them, and check that it fails

Yep two of the objects whose 3 fields are not unique together.


-- 
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Statesman
___________________________________________________________________________
You've got fun!  Check out Austin360.com for all the entertainment
info you need to live it up in the big city!

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

Reply via email to