Ticket #6733: field_testcase.py

File field_testcase.py, 400 bytes (added by Adam Gomaa, 17 years ago)

Testcase that fails on current trunk, passes with patch applied.

Line 
1from django import newforms as forms
2
3CHOICES = [(choi, choi) for choi in "One Two".split()]
4
5class TestForm(forms.Form):
6 number = forms.MultipleChoiceField(choices=CHOICES, required=False)
7
8foo = TestForm(dict(number=['One']))
9print foo
10assert 'selected="selected"' in str(foo)
11
12bar = TestForm(dict(number=['One']), prefix="mypre")
13print bar
14# Fails...
15assert 'selected="selected"' in str(bar)
16
Back to Top