diff options
author | ianb <devnull@localhost> | 2009-02-10 23:04:24 +0000 |
---|---|---|
committer | ianb <devnull@localhost> | 2009-02-10 23:04:24 +0000 |
commit | d17f27115bf83301ac843e5954d0c4555ac66052 (patch) | |
tree | e7fbe6ce5f998e404b87a2ca01809812a0e21a96 /docs/index.txt | |
parent | 231db64688b57af634fe4b6ddc9bc0fb607b19d7 (diff) | |
download | webtest-d17f27115bf83301ac843e5954d0c4555ac66052.tar.gz |
Applied patch from #337, from Matthew Desmarais: add a .force_value(value) method to select and multi-select fields that sets a value irregardless of the available options
Diffstat (limited to 'docs/index.txt')
-rw-r--r-- | docs/index.txt | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/index.txt b/docs/index.txt index fbc494f..e72e656 100644 --- a/docs/index.txt +++ b/docs/index.txt @@ -259,6 +259,11 @@ the response: >>> from webtest.debugapp import debug_app >>> map_app['/form-submit'] = debug_app + +Then submit: + +.. code-block:: python + >>> # Submit with no particular submit button pressed: >>> res = form.submit() >>> # Or submit a button: @@ -270,6 +275,11 @@ the response: -- Body ---------- submit=Submit%21&name=Bob +Select fields can only be set to valid values (i.e., values in an +``<option>``) but you can also use +``form['select-field'].force_value('value')`` to enter values not +present in an option. + Parsing the Body ================ @@ -369,6 +379,10 @@ svn trunk * Fix following links with fragments (these fragments should not be sent to the WSGI application). From desmaj. +* Added ``force_value`` to select fields, like + ``res.form['select'].force_value("new_value")``. This makes it + possible to simulate forms that are dynamically updated. + 1.1 --- |