I have a Django Model defined like below:
class CustomModel(models.Model):
column = models.CharField(max_length=50, unique=True)
Define a Factory for the model
from factory_boy import DjangoModelFactory
class CustomModelFactory(DjangoModelFactory):
column = 'V1'
FACTORY_FOR = CustomModelFactory()
How do i make sure that factory implements get_or_create instead of a create everytime?
Does anyone know how can this be done?
django_get_or_create
attribute and then we want to turn it off for some cases – Wiper