testing - Django test client post data is empty -


i have application have create simple post request using django test client.

userfrom = client() userfrom.login(username="admin1",password=test_password) data = {"some":"data"} responsenew = userfrom.post("/foo/too/",simplejson.dumps(data),content_type="application/json") 

when check post request @ view of "/foo/too/" post dictionary empty.

i have checked following question. not work. using django 1.5.

post dictionary empty

you can try like:

responsenew = userfrom.post("/foo/too/", data) 

Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -