Skip to content

Instantly share code, notes, and snippets.

@cansadadeserfeliz
Last active August 29, 2015 14:22
Show Gist options
  • Save cansadadeserfeliz/f930f6d02ef609c6a54c to your computer and use it in GitHub Desktop.
Save cansadadeserfeliz/f930f6d02ef609c6a54c to your computer and use it in GitHub Desktop.
Edd a new field with Django WebTests
from webtest.forms import Field
# ...
extra_field = Field(form, tag='input', name='new_field', pos=0, value='new_value')
form.fields['new_field'] = [extra_field]
form['new_field'] = 'new_value'
form.field_order.append(('new_field', extra_field))
# How to add a form to formset: https://github.com/kmike/django-webtest/pull/17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment