Ya, when I'm writing unit tests for my forms. What I wanted was a way in my
testing logic to generate a dictionary of values to post back to the server
based on the initial values of the forms in the content property of the
response object returned from the test client get() and/or post() methods.
Do you mean when you write tests?
If so, when you get the response you can extract all the variables
that was created inside the view if you're using locals().
That way, you can probably get the form instance (created for example
by form=MyForm(request.POST)) which you can then untangle to get
I'm working on putting together parsing logic so that I can extract the form
variables from the response content of the test Client. That way I can just
change a few values and throw it back at the server. This is especially
helpful with large dynamic forms that use formsets.
My question is, has
3 matches
Mail list logo