klen / mixer

Mixer -- Is a fixtures replacement. Supported Django, Flask, SqlAlchemy and custom python objects.
Other
939 stars 96 forks source link

Mongoengine DecimalField min and max value not works #109

Closed lucasrcezimbra closed 3 years ago

lucasrcezimbra commented 5 years ago

If a DecimalField has a min or max value, mixer doesn't respect these values and raises an validation exception:

class Post(Document):
    ...
    rating = DecimalField(precision=4, required=True, min_value=0)
    ...

post = mixer.blend(Post)
post.validate()

ValidationError: ValidationError (Post:5bede33f38a5b47c520458d9) (Decimal value is too small: ['rating'])

Looking the mixer code I found out that faker doesn't accept min and max values so I open a issue there to improve this: https://github.com/joke2k/faker/issues/870.