On Aug 25, 6:09 pm, Joshua Russo <josh.r.ru...@gmail.com> wrote:
> 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?

Here is a basic usage example:

    def test_htmlParse(self):

        response = self.client.get('/test/')
        self.failUnlessEqual(response.status_code, 200, 'Failed to
retrieve the form test page. (1)')

        curVals = response.form_values['frmTest']

        response = self.client.post('/test/', curVals)
        self.failUnlessEqual(response.status_code, 200, 'Failed to
retrieve the form test page. (2)')
--~--~---------~--~----~------------~-------~--~----~
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