@any_form_field.register(forms.MultipleChoiceField)<EOL>def multiple_choice_field_data(field, **kwargs):
if field.choices:<EOL><INDENT>from django_any.functions import valid_choices <EOL>l = list(valid_choices(field.choices))<EOL>random.shuffle(l)<EOL>choices = []<EOL>count = xunit.any_int(min_value=<NUM_LIT:1>, max_value=len(field.choices))<EOL>for i in xrange(<NUM_LIT:0>, count):<EOL><INDENT>choices.append(l[i])<EOL><DEDENT>return '<STR_LIT:U+0020>'.join(choices)<EOL><DEDENT>return '<STR_LIT:None>'<EOL>
Return random value for MultipleChoiceField

>>> CHOICES = [('YNG', 'Child'), ('MIDDLE', 'Parent') ,('OLD', 'GrandParent')]
>>> result = any_form_field(forms.MultipleChoiceField(choices=CHOICES))
>>> type(result)
<type 'str'>