klen / klen/mixer

Mixer generate a number higher then MaxValueValidator

Open
#84 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
953
Forks
91
PR merge metrics
No merged PRs in 30d

Description

hi @klen I am having an error with my model when I use as a constraint Min/MaxValueValidator.

```
from django.core.validators import MinValueValidator, MaxValueValidator

class Course(models.Model):
number_of_minutes = models.PositiveIntegerField(
validators=[
MinValueValidator(12),
MaxValueValidator(60)
]
)
```
in the shell

```
course = mixer.blend(Course)
course.number_of_minutes
=> 5645
```

So I want to know how to have the MaxValueValidator constraint

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the issue in the Django shell with the shown Course model and Mixer call. Trace how Mixer generates values for Django model fields with MinValueValidator and MaxValueValidator; done means generated number_of_minutes values stay between 12 and 60.

Written by the indexing model from the issue text.

Assessment

Tech stack
django, python
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.