I am trying to write a test for an XMLHtppRequest file upload, but I get a
strange error message.
I am manually assembling the request qs
csvfile = open('myfile.csv','rb')
buf = csvfile.read()
csvfile.close()
headers = {
'Content-length': '1115',
'Content-type': 'application/octect-stream',
'X-File-Size': '1115',
'X-File-Name': 'myfile.csv',
'X-Requested-With': 'XMLHttpRequest'
}
app.request('/upload', method='POST', headers=headers, body=buf)
the request is sent to a pyramid application, but there when I try to read
the body I get the error
File
"/Users/ruben/develop/pyrenv/lib/python3.3/site-packages/webob/request.py",
line 920, in make_body_seekable
self.body_file_raw.seek(0)
builtins.AttributeError: 'InputWrapper' object has no attribute 'seek'
Uploading the same file from my web application does not produce the
error.
Am I correct to assume that I webtest is not able to emulate such upload
request, or do I something wrong?
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.