1👍
You may be looking for the methods create_batch and build_batch, depending on whether you want to save the newly generated instances in the test
database or not.
Here’s an example which I copy-pasted and adapted from factory-boy documentation:
# --- models.py
class StudentFactory(factory.django.DjangoModelFactory):
class Meta:
model = Student
# --- test_student_factory.py
from . import factories
def make_objects():
factories.StudentFactory.create_batch(size=50)
Source:stackexchange.com