Not sure about the forms library, but you can use MultiDict (you might have to use UnicodeMultiDict in some cases, I'm not sure).
from webob.multidict import MultiDict class TestSomeController(TestController): def test_something(self): params = MultiDict() params.add('some_param', '1') params.add('color', 'Green') params.add('color', 'Blue') response = self.app.post(url('something'), params=params) assert 'something' in response
I never used WebTest to submit actual forms, but looking at the source of the Form class, you can set the index of the field that you want to set to disambiguate. I have not tested it, but maybe something like this:
form = response.form form.set('color', True, 0) form.set('color', True, 2)
source share