1π
β
It turns out that the decorator has a TypeError
error in this line:
session_string = args[-1] if 'session_key' in args[-1] else '[]'
So when args[-1]
is not str
then this should not work. Fixing it with str(args[-1])
resolves the whole issue with missing POST
data.
It is weird though that self.client.post
does not raise any TypeError
and session_string
was somehow calculated. Instead of this POST
data were not sent to the view without any errors or hint warnings. POST
data were just disappeared. At the same time the same code worked ok when POST
request was sent from web browser, so the error remained unnoticed.
π€Mikhail Geyer
Source:stackexchange.com