I have a department model in django:
from django.db import models
class Departement(models.Model):
name = models.CharField(max_length=128, db_index=True)
code = models.CharField(max_length=3, db_index=True)
I'd like to create a fixture with factory_boy with a consistent department name and code.
Faker has a department provider which returns a tuple with the code and the department (ex for french: https://faker.readthedocs.io/en/master/locales/fr_FR.html#faker.providers.address.fr_FR.Provider.department)
I have created a DepartmentFixture class but fail to understand how to use an instance of faker to call the faker.derpartments() method then populate the code/name fields accordingly.
I gues factory.Faker() is what you are searching for