On 9/9/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > > On 9/9/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > > > On Sun, 2007-09-09 at 21:46 +0800, Russell Keith-Magee wrote: > > > No - this has nothing to do with the test framework. It's a set of > > > helper functions to support writing clean_XXX methods. > > > > Okay. Then I'm mostly in agreement, except that I have two small > > problems with your "for consistency arguments": > > > > (1) They shouldn't be called "assertXYZ". Assertions are typically > > things that should never, ever fail. It's a programming error if they > > do. Passwords failing to match are not assertion failures. That's just a > > normal error checking path. > ... > > (2) We should use Django's normal naming scheme (underscores, etc), > ... > > Once you move away from using "assert", confusion with the unittest > > names will fade and the methods will be more self-explanatory. Maybe > > call them validate_equal(), validate_not_equal(), etc. > > Both valid points. Ok, sign me up for self.validate_equal() on BaseForm.
Does anybody else think that this might be interesting as a mix-in class? Something my form COULD inherit along with BaseForm to gain validation shortcuts, but that could also be used in models for example, so that when model validation comes up, we wouldn't duplicate code. The other reason for that is that I like Forms for their simplicity, this would add many methods that won't be used for simple forms (in my case, that's most of the forms I use) - but I agree that this is just my own personal feeling. ;) just a thought... btw. +1 on validate_equal VS assertEqual ;) > > Yours, > Russ Magee %-) > > > > -- Honza Kr�l E-Mail: [EMAIL PROTECTED] ICQ#: 107471613 Phone: +420 606 678585 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---
