Mock Form Post

S

Scooter

Let me qualify this by saying I'm very new to python. I'm doing some
work with mod_python and in a function I have defined I am passing in
the form and then iterating through the form keys. I'm currently
writing my unit tests and I'm trying to mock up a form object with
kids so I can emulate my true form post. So I'm attempting to mock up
a class that I'm calling "_Fakeform". I'm lost on how I should do it
though. I thought by creating a dictionary object with key value pairs
that would satisfy my need but I'm not sure how to get at it when I
pass my mocked class in.
 
S

Scooter

Let me qualify this by saying I'm very new to python. I'm doing some
work with mod_python and in a function I have defined I am passing in
the form and then iterating through the form keys. I'm currently
writing my unit tests and I'm trying to mock up a form object with
kids so I can emulate my true form post. So I'm attempting to mock up
a class that I'm calling "_Fakeform".  I'm lost on how I should do it
though. I thought by creating a dictionary object with key value pairs
that would satisfy my need but I'm not sure how to get at it when I
pass my mocked class in.

1 strike against me for poor proof reading.
1) While I did mention mod_python I didn't say I was referring to an
HTML form.
2) I said I'm trying to mock up a form object with "kids". No idea how
I messed that up, but it should be "keys"
 
D

Diez B. Roggisch

Scooter said:
1 strike against me for poor proof reading.
1) While I did mention mod_python I didn't say I was referring to an
HTML form.
2) I said I'm trying to mock up a form object with "kids". No idea how
I messed that up, but it should be "keys"

If you'd use mod_wsgi, you could create a WSGI-application that's easily
testable with paste fixture, including filling out forms, following
redirects and all that.

Diez
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,600
Members
45,179
Latest member
pkhumanis73
Top