Skip to content

chore(dev): add factory_boy seed data and seed_db management commands#10

Merged
aleattene merged 10 commits into
mainfrom
chore/seed-db
Mar 28, 2026
Merged

chore(dev): add factory_boy seed data and seed_db management commands#10
aleattene merged 10 commits into
mainfrom
chore/seed-db

Conversation

@aleattene

Copy link
Copy Markdown
Owner
  • Add factory_boy and faker to requirements_dev
  • Add factories/ package with factories for all models
  • Add seed_db management command (with --flush option)
  • Document seed command in README

- Add factory_boy + faker to requirements_dev
- Add factories/ package with factories for all models
- Add seed_db management command (with --flush option)
- Document seed command in README
@aleattene aleattene self-assigned this Mar 27, 2026
@vercel

vercel Bot commented Mar 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
asd-management-django Ready Ready Preview, Comment Mar 28, 2026 10:28am

@codecov-commenter

codecov-commenter commented Mar 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.73463% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.72%. Comparing base (76ef429) to head (2264cda).

Files with missing lines Patch % Lines
users/management/commands/seed_db.py 96.93% 5 Missing ⚠️
config/settings/base.py 75.00% 1 Missing ⚠️
config/settings/test.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #10      +/-   ##
==========================================
+ Coverage   95.17%   95.72%   +0.55%     
==========================================
  Files          89       98       +9     
  Lines        1119     1427     +308     
==========================================
+ Hits         1065     1366     +301     
- Misses         54       61       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a development-only seeding workflow to generate realistic local data using factory_boy/faker, along with documentation for how to run it.

Changes:

  • Added factory-boy and faker to dev requirements.
  • Introduced a factories/ package with model factories across apps.
  • Added a seed_db management command (with optional --flush) and documented usage in the README.

Reviewed changes

Copilot reviewed 12 out of 15 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
users/management/commands/seed_db.py New management command to seed dev data (users, athletes, enrollments, finance docs, etc.).
factories/__init__.py Central export surface for all factories used by the seed command.
factories/users.py CustomUser factory.
factories/staff.py Trainer factory.
factories/athletes.py Category/Athlete factories.
factories/enrollments.py Enrollment factory.
factories/doctors.py SportDoctor factory.
factories/certificates.py SportCertificate factory with date relationship logic.
factories/finance.py Company, PaymentMethod, Invoice, Receipt factories.
requirements_dev.in Declares new dev dependencies (factory-boy, faker).
requirements_dev.txt Compiled/pinned dev dependency set reflecting the new inputs.
README.md Documents how to run seed_db and seed_db --flush.
.gitignore Ignores docs/DEVELOPMENT.md.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread users/management/commands/seed_db.py Outdated
Comment thread users/management/commands/seed_db.py Outdated
Comment thread users/management/commands/seed_db.py Outdated
Comment thread users/management/commands/seed_db.py Outdated
Comment thread users/management/commands/seed_db.py Outdated
Comment thread users/management/commands/seed_db.py
Comment thread users/management/commands/seed_db.py

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 18 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread users/management/commands/seed_db.py Outdated
Comment thread users/tests/test_seed_db.py
Comment thread config/settings/base.py Outdated
Comment thread users/management/commands/seed_db.py Outdated
Comment thread users/management/commands/seed_db.py
Comment thread users/management/commands/seed_db.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 20 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread users/management/commands/seed_db.py
Comment thread users/management/commands/seed_db.py Outdated
Comment thread users/management/commands/seed_db.py
Comment thread users/management/commands/seed_db.py
Comment thread config/settings/development.py Outdated
Comment thread config/settings/test.py Outdated
Comment thread users/management/commands/seed_db.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 19 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md
Comment thread users/management/commands/seed_db.py Outdated
Comment thread users/management/commands/seed_db.py

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 19 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread users/management/commands/seed_db.py Outdated
Comment thread factories/staff.py Outdated
Comment thread users/management/commands/seed_db.py Outdated
Comment thread users/management/commands/seed_db.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 19 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread users/management/commands/seed_db.py Outdated
Comment thread users/management/commands/seed_db.py
Comment thread users/management/commands/seed_db.py Outdated
Comment thread users/management/commands/seed_db.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 19 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread users/management/commands/seed_db.py Outdated
Comment thread config/settings/base.py

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 19 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread users/management/commands/seed_db.py

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 19 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread factories/__init__.py
@aleattene aleattene merged commit 16568ce into main Mar 28, 2026
7 checks passed
@aleattene aleattene deleted the chore/seed-db branch March 28, 2026 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants