Re: How can I print form errors from inside the test

2012-03-15 Thread Mario Gudelj
All I had to do is to change initial=base_data to data=base_data and the thing worked. is_valid() and is_bound now work. Cheers, -m On 15 March 2012 12:20, Daniel Roseman wrote: > On Wednesday, 14 March 2012 16:43:12 UTC-7, somecallitblues wrote: >> >> Thanks Daniel and

Re: How can I print form errors from inside the test

2012-03-14 Thread Daniel Roseman
On Wednesday, 14 March 2012 16:43:12 UTC-7, somecallitblues wrote: > > Thanks Daniel and Karen, > > Karen, I;'m not entirely sure what an unbound form is. :) > Then you must not have read the documentation[1], which goes into great detail about bound and unbound forms. That's pretty much a

Re: How can I print form errors from inside the test

2012-03-14 Thread Mario Gudelj
Thanks Daniel and Karen, Karen, I;'m not entirely sure what an unbound form is. :) Anyway, this is my test code: def test_appointment_form(self): c = Client() base_data = { 'name':'Foo name', 'slug':'foo-session', 'short_descr':'foo

Re: How can I print form errors from inside the test

2012-03-14 Thread Karen Tracey
The most common reason I have seen for is_valid() to return False but errors to be empty is for the form to be unbound. Unbound forms are never valid, but they also don't have any errors. Which goes to Daniel's question: how exactly have you "preloaded" the form with data? Karen --

Re: How can I print form errors from inside the test

2012-03-13 Thread Daniel Roseman
On Tuesday, 13 March 2012 19:06:13 UTC-7, somecallitblues wrote: > > I preload the data into the form and when I validate it returns False. > > *How* do you "preload" the data? How do you validate it? -- DR. -- You received this message because you are subscribed to the Google Groups "Django

How can I print form errors from inside the test

2012-03-13 Thread Mario Gudelj
Hi djangoers, I have a problem where I'm running some form tests, the form validation is failing, and I'm not sure why it's failing and I can't figure out how to print the errors. I preload the data into the form and when I validate it returns False. >>> form.is_valid() False If I print the