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

add development fixtures #1350

Closed
2 tasks
Tracked by #1342
brylie opened this issue Sep 28, 2022 · 15 comments · Fixed by #1496 · May be fixed by #1401
Closed
2 tasks
Tracked by #1342

add development fixtures #1350

brylie opened this issue Sep 28, 2022 · 15 comments · Fixed by #1496 · May be fixed by #1401

Comments

@brylie
Copy link
Member

brylie commented Sep 28, 2022

Model factories can help us scaffold content quickly for development purposes.

Let's define a factory.py file in every app containing a models.py. The factory.py files will contain factories for the models in the same app. E.g.,

  • project/categories/models.py - model definitions for categories app
  • project/categories/factory.py - factory definitions for categories app

Task

@Walexero
Copy link

Would love to work on this issue, and would need your help with completing the second requirements

@brylie
Copy link
Member Author

brylie commented Sep 30, 2022

Ok. Let's start with one issue at a time for now.

@Walexero
Copy link

Walexero commented Oct 1, 2022

okay, would start working in it, would, would make a pull request now

@Walexero
Copy link

Walexero commented Oct 2, 2022

Have already added factory boy into the project with the provided command, can you expatiate on the second task

@Walexero

This comment was marked as resolved.

@brylie

This comment was marked as resolved.

@Walexero
Copy link

Walexero commented Oct 4, 2022

is there a specific folder you want me to define the initial factory_boy factory into and a specific filename to be used. Please expatiate

@brylie
Copy link
Member Author

brylie commented Oct 4, 2022

Let's define a factory.py file in every app where we also have a models.py. The factory.py files will contain factories for the models in the same app. E.g.,

  • project/categories/models.py - model definitions for categories app
  • project/categories/factory.py - factory definitions for categories app

@Walexero
Copy link

Walexero commented Oct 4, 2022

okay, would get it done now

Walexero added a commit to Walexero/OpenCiviWiki that referenced this issue Oct 4, 2022
Walexero added a commit to Walexero/OpenCiviWiki that referenced this issue Oct 10, 2022
Walexero added a commit to Walexero/OpenCiviWiki that referenced this issue Oct 11, 2022
Walexero added a commit to Walexero/OpenCiviWiki that referenced this issue Oct 20, 2022
@Nehemiah60
Copy link
Contributor

Hello, @brylie. I will wait in line if this issue is still open. I would wish to be assigned this. Thanks.

@Nehemiah60
Copy link
Contributor

Hello, @brylie. I created the factories model factories for one app first. I want to merge changes, get your feedback, and then I can go on step by step. I think that will be easier until I manage all the apps. Thanks.
And also I made a PR 3 days ago on template porting to Django syntax. I am still awaiting feedback. Thanks.

@Nehemiah60
Copy link
Contributor

Hello, @brylie. Here is my first PR. I will be waiting for your feedback so that I can move to create the factories for the apps with models. Thanks.
0f02e6f

@Nehemiah60
Copy link
Contributor

Hello @brylie , I made a new PR on this issue 762f44a. I also added a factory file for the categories app. If you get time can also go through the threads and accounts app. However, there are issues with duplicated blocks of codes, which I had to comment on both in the threads and accounts app, factory.py files. I would appreciate your help. Thanks.

@brylie
Copy link
Member Author

brylie commented Feb 10, 2023

We can disregard the warnings about duplicate code blocks.

@Nehemiah60
Copy link
Contributor

Hello @brylie. Kindly review this PR 1345209

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment