I'd like to use the test client to verify that when there's an error
in a form field, the input field in the
response is populated with the original input.
So I'd like to do something like:
iteration = 'bad data'
response = self.client.post('/metrics/add/', {
'iteration' : iteration,
... }
...
self.failUnlessEqual(response.context[0]['form'].fields
['iteration'].value), 'bad data')
Would be great to know where I can fish this from (the last line in
the above snippet is just for illustration of how I would hope to
access the value)
Django version is 1.0, the form is a ModelForm in case it matters.
Cheers
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---