Installation and Quick Start¶
Quick Start¶
Factory Djoy provides a UserFactory
out of the box which will build valid
instances of the default Django contrib auth User
model.
from factory_djoy import UserFactory
user = UserFactory()
For any other Django models that you would like valid instances for, create
your factory by inheriting from CleanModelFactory
.
from factory_djoy import CleanModelFactory
from project.app.models import Item
class ItemFactory(CleanModelFactory):
class Meta:
model = Item