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

✅(dashboard) update tests with factory boy #239

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

ssorin
Copy link
Collaborator

@ssorin ssorin commented Nov 22, 2024

Purpose

Use Factory Boy to generate factories and integrate them into existing tests

Add

  • Add factory-boy to Pipfile
  • add factories for the models : auth.DashboardUser, consent.Consent, core.Entity, core.DeliveryPoint

Update

  • Update tests with new factories

@ssorin ssorin self-assigned this Nov 22, 2024
@ssorin ssorin requested a review from jmaupetit November 22, 2024 14:01
@ssorin ssorin added feature needs review dashboard Item related to the Dashboard service labels Nov 22, 2024
Copy link
Member

@jmaupetit jmaupetit left a comment

Choose a reason for hiding this comment

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

I only have fine-tuning suggestion to fully use Factory boy + Faker possibilities. 😉

src/dashboard/apps/auth/factories.py Outdated Show resolved Hide resolved
src/dashboard/apps/auth/factories.py Outdated Show resolved Hide resolved
src/dashboard/apps/consent/factories.py Outdated Show resolved Hide resolved
src/dashboard/apps/core/factories.py Outdated Show resolved Hide resolved
src/dashboard/apps/auth/factories.py Outdated Show resolved Hide resolved
@ssorin ssorin force-pushed the feature/dashboard/update-tests-with-factory-boy branch from e272b65 to 2cc1b76 Compare November 25, 2024 16:54
@ssorin ssorin marked this pull request as ready for review November 25, 2024 16:58
Copy link
Member

@jmaupetit jmaupetit left a comment

Choose a reason for hiding this comment

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

I only have a minor remark. 👍

src/dashboard/apps/auth/factories.py Outdated Show resolved Hide resolved
- Add factory-boy to Pipfile
- add factories for apps: auth, content, core
- Update tests with new factories
@ssorin ssorin force-pushed the feature/dashboard/update-tests-with-factory-boy branch from 2cc1b76 to 1cfa47f Compare November 26, 2024 13:12
@ssorin ssorin merged commit b26402b into main Nov 26, 2024
20 of 21 checks passed
@ssorin ssorin deleted the feature/dashboard/update-tests-with-factory-boy branch November 26, 2024 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dashboard Item related to the Dashboard service feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants