diff options
| author | Gael Pasgrimaud <gael@gawel.org> | 2022-01-19 08:55:34 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-19 08:55:34 +0100 |
| commit | b0426fc2952ba45de75cbd37db350281dce101df (patch) | |
| tree | 821d6e8d5cf77a4505042a03fb1fb4905dd36b28 /docs | |
| parent | 2719819e5ac26bdc0cf39879ca4d3879ae9eb0c9 (diff) | |
| parent | d1dbc25f53a031d03112cb1e44f4a060cf3665cd (diff) | |
| download | webtest-master.tar.gz | |
Merge pull request #242 from azmeuk/issue-240-multiple-file-inputmaster
Support for multiple file input
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/forms.rst | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/docs/forms.rst b/docs/forms.rst index 6e5b7c9..8f4ff4c 100644 --- a/docs/forms.rst +++ b/docs/forms.rst @@ -197,6 +197,17 @@ You can deal with file upload by using the Upload class: >>> form['file'] = Upload('README.rst', b'data') >>> form['file'] = Upload('README.rst', b'data', 'text/x-rst') +If the file field has a ``multiple`` parameter, you can pass a +list of :class:`~webtest.forms.Upload`: + +.. code-block:: python + + >>> from webtest import Upload + >>> form['files'] = [ + ... Upload('README.rst'), + ... Upload('LICENSE.rst'), + ... ] + Submit a form -------------- |
