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

Replace fakestudies and fakefiles with a fakeorgs command #649

Open
dankolbman opened this issue May 17, 2021 · 2 comments
Open

Replace fakestudies and fakefiles with a fakeorgs command #649

dankolbman opened this issue May 17, 2021 · 2 comments
Assignees
Labels
refactor Something needs to be done better

Comments

@dankolbman
Copy link
Contributor

In order to bootstrap mock data, we currently run fakestudies followed by fakefiles. This creates a handful of fake studies and then will add a bunch of fake files to those studies.
This is a little non-sensible because the study factory should call on the file factory to create studies whenever a fake study is created. Furthermore, now with the idea of organizations, the organization factory should create studies which will create files. If these factories are setup correctly, we should be able to create a simple fakeorgs command which will call OrganizationFactory.create_batch(n) which will take care of all the mock data setup.

@dankolbman dankolbman added the refactor Something needs to be done better label May 17, 2021
@gsantia gsantia self-assigned this Jun 29, 2021
@gsantia
Copy link
Contributor

gsantia commented Jun 29, 2021

The way it's setup now you can decide how many studies/files you want created, but I assume this won't be the case for a single fakeorgs command. Should we just use the default values for both of these then?

@dankolbman
Copy link
Contributor Author

We could use the current defaults but perhaps we could still retain the flags.
User's could do something like: python manage.py fakeorgs --orgs 2 --studies 5 --files 3 and it would give 2 orgs each with 5 studies that contain 3 files.
I'm not sure those would be that useful, however, so maybe just let the subfactories decide how to do it. We can still keep the fakestudies and fakeorgs commands in case we need a specific number of studies/files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Something needs to be done better
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants