Re: Testing form posting

2009-03-29 Thread Martin Ostrovsky
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

Testing form posting

2009-03-28 Thread tsmets
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