Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Test Cases to Insert Over 1,000 Records in Each DB Table to Optimize API Performance #498

Open
ghost opened this issue Aug 26, 2024 · 2 comments
Assignees
Labels
backend enhancement New feature or request
Milestone

Comments

@ghost
Copy link

ghost commented Aug 26, 2024

Read about https://pypi.org/project/django-faker/

from django_faker import Faker
# this Populator is only a function thats return a django_faker.populator.Populator instance
# correctly initialized with a faker.generator.Generator instance, configured as above
populator = Faker.getPopulator()

from myapp.models import Game, Player
populator.addEntity(Game,5)
populator.addEntity(Player,10)

insertedPks = populator.execute()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants
@Mahmoud-Emad and others