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.
you can try like:
responsenew = userfrom.post("/foo/too/", data)
Comments
Post a Comment