Hi,

some time ago I wrote a snippet which does this:

http://www.djangosnippets.org/snippets/467/

{{{
If you want to test a post request to a form, you need to give all input 
fields, even if you just want to test if one
value gets changed.

This snippets parses the HTML of a view and gives you a dictionary that you can 
give to django.test.Client.

Needs ClientForm from: http://wwwsearch.sourceforge.net/ClientForm/
}}}


Joshua Russo schrieb:
> I've just put together an enhancement of the test Client used in unit
> testing. I added the parsing of the content to extract the form fields with
> their initial values as a dictionary, so you can just change a few values
> and throw it back at the server.
> http://dpaste.com/hold/85281/
> 
> I had to do a small monkey patch to get it to work because direct override
> of the __ call __ method interfered with the transaction management for some
> reason.
> 
> Let me know what you think. Should I submit it as a ticket?

-- 
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to