Last active
August 29, 2015 14:22
-
-
Save cansadadeserfeliz/f930f6d02ef609c6a54c to your computer and use it in GitHub Desktop.
Edd a new field with Django WebTests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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