Closed elcolie closed 7 years ago
You can try using the ChoicesGenerator
(https://github.com/gregmuellegger/django-autofixture/blob/master/autofixture/generators.py#L230), like this:
from models import YourCarModel
from autofixture import generators, register, AutoFixture
class YourCarModelAutoFixture(AutoFixture):
field_values = {
'brand': generators.ChoicesGenerator(values=your_list_of_brands),
}
register(YourCarModel, MyModelAutoFixture)
Support I want to generate a
car
lists with random brand. But brands are from my given list. Can I do that in your autofixture?