Hello,
I'm testing my application code using py.test (not viniciusban's system). I have a something.py controller, with an add function.
In forms_something (a module):
def add_form(o):
if some conditions:
o['add_form'] = add_form
In something.py:
from forms_something import add_form
and then I use it in add(), like:
o = {}
add_form(o)
Now, if I go to the shell, with "-S appname/something -M", I can generate the appname/something/add html using "response.render('something/add.html', add())". This is enough to see the form was generated based on the specified conditions. What I want to do next is submit the form and check that it works fine (validates, generates errors), and that various DB changes do occur.
At this moment, I tried request.env.update(request_method='POST'), but even if I do that, the response.render only shows the form in the initial stage. I also did something like request.post_vars.update(form_field='value'), but with no effect. My intuition tells me it's just a matter of POSTing instead of GETting, but I don't know what to do next.