You're POSTing the form instance, rather than the postedData.
So:
response = self.client.post('/myApp/post', form)
should be:
response = self.client.post('/myApp/post/', postedData)
More info here:
http://docs.djangoproject.com/en/dev/topics/testing/#making-requests
On Mar 28, 9:14 pm, tsme
I was wondering how I could test / unittest form posting ?
class TestSomeRequest(TestCase):
def testCallDefaultDpasteURL(self):
response = self.client.get('/my_app/')
self.failUnlessEqual(response.status_code, 200)
def testCallDpasteAboutURL(self):
postedData = {
'poster
2 matches
Mail list logo