django_any/forms.py
def float_field_data(field, **kwargs):
    """
    Return random value for FloatField

    >>> result = any_form_field(forms.FloatField(max_value=200, min_value=100))
    >>> type(result)
    <type 'str'>
    >>> float(result) >=100, float(result) <=200
    (True, True)
    """
    min_value = 0
    max_value = 100
    from django.core.validators import MinValueValidator, MaxValueValidator
    for elem in field.validators:
        if isinstance(elem, MinValueValidator):
            min_value = elem.limit_value
        if isinstance(elem, MaxValueValidator):
            max_value = elem.limit_value

    min_value = kwargs.get('min_value', min_value)
    max_value = kwargs.get('max_value', max_value)
    precision = kwargs.get('precision', 3)

    return str(xunit.any_float(min_value=min_value, max_value=max_value, precision=precision))
def float_field_data(field, **kwargs):
    min_value = 0
    max_value = 100
    from django.core.validators import MinValueValidator, MaxValueValidator
    for elem in field.validators:
        if isinstance(elem, MinValueValidator):
            min_value = elem.limit_value
        if isinstance(elem, MaxValueValidator):
            max_value = elem.limit_value

    min_value = kwargs.get('min_value', min_value)
    max_value = kwargs.get('max_value', max_value)
    precision = kwargs.get('precision', 3)

    return str(xunit.any_float(min_value=min_value, max_value=max_value, precision=precision))
def float_field_data ( field , * * kwargs ) : min_value = 0 max_value = 100 from django . core . validators import MinValueValidator , MaxValueValidator for elem in field . validators : if isinstance ( elem , MinValueValidator ) : min_value = elem . limit_value if isinstance ( elem , MaxValueValidator ) : max_value = elem . limit_value min_value = kwargs . get ( 'min_value' , min_value ) max_value = kwargs . get ( 'max_value' , max_value ) precision = kwargs . get ( 'precision' , 3 ) return str ( xunit . any_float ( min_value = min_value , max_value = max_value , precision = precision ) )
Return random value for FloatField

    >>> result = any_form_field(forms.FloatField(max_value=200, min_value=100))
    >>> type(result)
    <type 'str'>
    >>> float(result) >=100, float(result) <=200
    (True, True)
Return random value for FloatField