Re: unit testing and comparing dictionaries

2008-06-17 Thread Gene Campbell
sorry, omitted 'self' by accident. There are a couple things going on here. One is that type-o. The other is more of an open question as to what should be tested, and how. I'm coming around to the this. for each model I'll will 1) assume that clients that use the model code will test it indir

Re: unit testing and comparing dictionaries

2008-06-17 Thread Paul Winkler
On Jun 17, 1:46 am, "Gene Campbell" <[EMAIL PROTECTED]> wrote: > Hello Djangonauts > > I'm a noob on both Django and Python, so this question might be easy > for the experts out there. I am trying to do test first development > during the development of my model code. (I have lots of experience

Re: unit testing and comparing dictionaries

2008-06-17 Thread Norman Harman
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) > > We

Re: unit testing and comparing dictionaries

2008-06-17 Thread Gene Campbell
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 t

Re: unit testing and comparing dictionaries

2008-06-17 Thread Gene Campbell
Thanks. In this case, I'm doing a bit extra in work order to learn Python and Django. And, I do see how testing models such that all the fields are equal is a waste on the basis that Django should be testing that that functionality works. On Wed, Jun 18, 2008 at 2:48 AM, Norman Harman <[EMAIL

Re: unit testing and comparing dictionaries

2008-06-17 Thread John
Dictionaries compare equal if they contain the same data, regardless of key order. There is no need to convert to sorted sequences unless you need to compare the serialized output (such as in doctests). I would guess that one of the models has additional fields added to its __dict__, perhaps thro

Re: unit testing and comparing dictionaries

2008-06-17 Thread Norman Harman
Gene Campbell wrote: > Hello Djangonauts > > I'm a noob on both Django and Python, so this question might be easy > for the experts out there. I am trying to do test first development > during the development of my model code. (I have lots of experience > with test first coding in the Java worl

unit testing and comparing dictionaries

2008-06-16 Thread Gene Campbell
Hello Djangonauts I'm a noob on both Django and Python, so this question might be easy for the experts out there. I am trying to do test first development during the development of my model code. (I have lots of experience with test first coding in the Java world, no practical experience in the