Re: Newb testing question

2008-11-04 Thread Rick Kitts
On Nov 4, 2008, at 1:00 PM, Karen Tracey wrote: > [...snip...] > The order of things during validation is specified clearly in the > docs: > > http://docs.djangoproject.com/en/dev/ref/forms/validation/ This was useful, thanks. > > > This page has a subsection on cleaning fields that depend on

Re: Newb testing question

2008-11-04 Thread Karen Tracey
On Tue, Nov 4, 2008 at 2:06 PM, Rick Kitts <[EMAIL PROTECTED]> wrote: > Well, I think it's clear what I see. I sort of disagree about the impl, > design, call it what you will. > It wasn't clear to me what you had seen nor what you wanted to argue about though you have clarified that some in this

Re: Newb testing question

2008-11-04 Thread Rick Kitts
Well, I think it's clear what I see. I sort of disagree about the impl, design, call it what you will. Specifically, the current impl makes testing harder than it needs to be, or at least the testing that I'd like to do. That is, I have a field, that field has validation rules and I'd like t

Re: Newb testing question

2008-11-04 Thread Karen Tracey
On Tue, Nov 4, 2008 at 12:07 PM, Rick <[EMAIL PROTECTED]> wrote: > > Give a man a fish... > > Right, so I see now what's going on. Is this the right place to argue > about how this works? > It isn't clear what you see or what you want to argue about? cleaned_data is established when the form is

Re: Newb testing question

2008-11-04 Thread Rick
Give a man a fish... Right, so I see now what's going on. Is this the right place to argue about how this works? ---Rick On Nov 4, 8:46 am, Rick Kitts <[EMAIL PROTECTED]> wrote: > Thanks, it does but this is a bad test methodology. is_valid()   > verifies the entire form and there is no way of

Re: Newb testing question

2008-11-04 Thread Rick Kitts
Thanks, it does but this is a bad test methodology. is_valid() verifies the entire form and there is no way of knowing in the test if the validation is failing because of other reasons or the specific one I (think) I'm testing. I guess the broader question then is when is cleaned_data estab

Re: Newb testing question

2008-11-04 Thread Dan Fairs
> Running the test causes a splash of barf that says: > > AttributeError: 'TheFormClass' object has no attribute 'cleaned_data' > Try calling form.is_valid() (which should in addition return whether the validation framework as a whole thought the form was valid). This should invoke your clean

Newb testing question

2008-11-03 Thread Rick Kitts
Greetings. I'm digging django pretty good. Many thanks. I've run into a problem that I'm sure is my fault but I don't know why yet. I've got a ModelForm and I'm trying to write unit tests for the validation bits. My strategy here was to construct an instance of the form and populate it with