Ticket #3129: multiple_choice_tests.patch
File multiple_choice_tests.patch, 953 bytes (added by , 18 years ago) |
---|
-
tests/regressiontests/forms/tests.py
1672 1672 <li><label><input checked="checked" type="checkbox" name="composers" value="P" /> Paul McCartney</label></li> 1673 1673 </ul> 1674 1674 1675 >>> data = dict(name='Yesterday', composers=['J', 'P']) 1676 >>> f = SongForm(data) 1677 >>> f.errors 1678 {} 1679 1680 >>> from django.http import QueryDict 1681 >>> data = QueryDict('name=Yesterday&composers=J&composers=P') 1682 >>> f = SongForm(data) 1683 >>> f.errors 1684 {} 1685 1686 >>> from django.utils.datastructures import MultiValueDict 1687 >>> data = MultiValueDict(dict(name='Yesterday', composers=['J', 'P'])) 1688 >>> f = SongForm(data) 1689 >>> f.errors 1690 {} 1691 1675 1692 When using CheckboxSelectMultiple, the framework expects a list of input and 1676 1693 returns a list of input. 1677 1694 >>> f = SongForm({'name': 'Yesterday'}, auto_id=False)