diff options
author | Gael Pasgrimaud <gael@gawel.org> | 2015-02-08 14:33:20 +0100 |
---|---|---|
committer | Gael Pasgrimaud <gael@gawel.org> | 2015-02-08 14:33:20 +0100 |
commit | 3ec0c83d096311481979d8440daa4787b87d21bc (patch) | |
tree | 08da19213085298e206d16bdd22328136edcd7f2 | |
parent | 2e283cb0e6f61130702fab7dd1385d0085961ab4 (diff) | |
parent | d1fb6b6d72b7bbd5975607def8e1859c639dd401 (diff) | |
download | webtest-3ec0c83d096311481979d8440daa4787b87d21bc.tar.gz |
Merge pull request #132 from maykinmedia/issue-131
fixed #131 prevent passing HTML parameters that conflict with Field kwargs
-rw-r--r-- | webtest/forms.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/webtest/forms.py b/webtest/forms.py index b84c08f..d444229 100644 --- a/webtest/forms.py +++ b/webtest/forms.py @@ -452,6 +452,12 @@ class Form(object): attrs = dict((k.encode('utf-8') if isinstance(k, unicode) else k, v) for k, v in attrs.items()) + # https://github.com/Pylons/webtest/issues/131 + reserved_attributes = ('form', 'tag', 'pos') + for attr in reserved_attributes: + if attr in attrs: + del attrs[attr] + if tag == 'input': if tag_type == 'radio': field = fields.get(name) |