diff options
| author | Michael Howitz <mh@gocept.com> | 2017-02-05 18:37:38 +0100 |
|---|---|---|
| committer | Michael Howitz <mh@gocept.com> | 2017-02-05 18:37:38 +0100 |
| commit | 83d221698cdfb355aae5c12c836001557e4be63f (patch) | |
| tree | 4591303fdb06540521b39e6c343c712d489138dd /webtest | |
| parent | 88d1c1b2708f13bfbf31f7041e235bd43d75c57d (diff) | |
| download | webtest-83d221698cdfb355aae5c12c836001557e4be63f.tar.gz | |
Fix #173: Do not omit file uploads without a file from post.
Diffstat (limited to 'webtest')
| -rw-r--r-- | webtest/app.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/webtest/app.py b/webtest/app.py index 7a20186..7a7afbf 100644 --- a/webtest/app.py +++ b/webtest/app.py @@ -503,6 +503,10 @@ class TestApp(object): if isinstance(value, forms.File): if value.value: _append_file([key] + list(value.value)) + else: + # If no file was uploaded simulate an empty file with no + # name like real browsers do: + _append_file([key, b'', b'']) elif isinstance(value, forms.Upload): file_info = [key, value.filename] if value.content is not None: |
