New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
int & files in a form #18
Comments
try to use form['structure-total_number_of_employees'].value = 50 |
It's the same with .value |
Could you please report this to https://github.com/Pylons/webtest ? |
Yes of course will do now. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
first of all, thanks a lot for that project, it does help a lot with writing great tests in Django.
I'm using the latest stable version of webtest (1.7.5)
I used to have a form like this with the test passing:
form = response.form
form['structure-total_number_of_employees'] = 50
...
response = form.submit()
Then when I've added a file to that and updated my code:
form = response.form
form['logo'] = ...
form['structure-total_number_of_employees'] = 50
...
response = form.submit()
It crashed with the following error:
virtual_env/dev_env/lib/python2.7/site-packages/webtest/app.py", line 382, in encode_multipart
body = b'\r\n'.join(lines)
TypeError: sequence item 12: expected string, int found
To get it to work, I've replaced 50 by "50":
form = response.form
form['logo'] = ...
form['structure-total_number_of_employees'] = "50"
...
response = form.submit()
I reckon that the encode multipart should be updated to handle integers.
The text was updated successfully, but these errors were encountered: