Django

Code

Changeset 5226

Show
Ignore:
Timestamp:
05/14/07 05:18:29 (2 years ago)
Author:
mtredinnick
Message:

unicode: Improved the test slightly for RadioSelect? widgets with unicode
choices.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/unicode/tests/regressiontests/forms/regressions.py

    r4971 r5226  
    3131 
    3232Unicode decoding problems... 
    33 >>> GENDERS = (('0', u'En tied\xe4'), ('1', u'Mies'), ('2', u'Nainen')) 
     33>>> GENDERS = ((u'\xc5', u'En tied\xe4'), (u'\xf8', u'Mies'), (u'\xdf', u'Nainen')) 
    3434>>> class SomeForm(Form): 
    35 ...     somechoice = ChoiceField(choices=GENDERS, widget=RadioSelect()
     35...     somechoice = ChoiceField(choices=GENDERS, widget=RadioSelect(), label=u'\xc5\xf8\xdf'
    3636>>> f = SomeForm() 
    3737>>> f.as_p() 
    38 u'<p><label for="id_somechoice_0">Somechoice:</label> <ul>\n<li><label><input type="radio" id="id_somechoice_0" value="0" name="somechoice" /> En tied\xe4</label></li>\n<li><label><input type="radio" id="id_somechoice_1" value="1" name="somechoice" /> Mies</label></li>\n<li><label><input type="radio" id="id_somechoice_2" value="2" name="somechoice" /> Nainen</label></li>\n</ul></p>' 
     38u'<p><label for="id_somechoice_0">\xc5\xf8\xdf:</label> <ul>\n<li><label><input type="radio" id="id_somechoice_0" value="\xc5" name="somechoice" /> En tied\xe4</label></li>\n<li><label><input type="radio" id="id_somechoice_1" value="\xf8" name="somechoice" /> Mies</label></li>\n<li><label><input type="radio" id="id_somechoice_2" value="\xdf" name="somechoice" /> Nainen</label></li>\n</ul></p>' 
    3939"""