@any_form_field.register(forms.IntegerField)<EOL>def integer_field_data(field, **kwargs):
min_value = <NUM_LIT:0><EOL>max_value = <NUM_LIT:100><EOL>from django.core.validators import MinValueValidator, MaxValueValidator <EOL>for elem in field.validators:<EOL><INDENT>if isinstance(elem, MinValueValidator):<EOL><INDENT>min_value = elem.limit_value<EOL><DEDENT>if isinstance(elem, MaxValueValidator):<EOL><INDENT>max_value = elem.limit_value<EOL><DEDENT><DEDENT>min_value = kwargs.get('<STR_LIT>', min_value)<EOL>max_value = kwargs.get('<STR_LIT>', max_value)<EOL>return str(xunit.any_int(min_value=min_value, max_value=max_value))<EOL>
Return random value for IntegerField

>>> result = any_form_field(forms.IntegerField(max_value=200, min_value=100))
>>> type(result)
<type 'str'>
>>> int(result) >=100, int(result) <=200
(True, True)