Add tests for submit entity body

This commit is contained in:
Keith Yeung 2016-04-25 05:40:54 -04:00
parent 16361086d9
commit e1091128cd
3 changed files with 62 additions and 0 deletions

View file

@ -0,0 +1,12 @@
def main(request, response):
if request.headers.get('Content-Type') == 'application/x-www-form-urlencoded':
if request.body == 'foo=bara':
return 'OK'
else:
return 'FAIL'
else:
if request.POST.first('foo') == 'bar':
return 'OK'
else:
return 'FAIL'