Skip to content

refactor: consolidate repetitive model instantiations across tests #3416

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

Open
wants to merge 2 commits into
base: 5.x
Choose a base branch
from

Conversation

zigzagdev
Copy link

@zigzagdev zigzagdev commented Jun 24, 2025

Description

This pull request refactors the test suite to eliminate redundant model instantiations. Several test cases repeatedly constructed identical User, Item, and Book model objects inline, leading to code duplication and reduced maintainability.

To address this:

  • A set of factory-like helper methods has been introduced to create consistent test data.
  • All repeated inline instantiations were replaced by these shared methods.
  • This improves readability, enforces consistency, and simplifies future updates.

This is a non-functional change (refactor only) and does not alter the behaviour or scope of any existing tests.

Checklist

  • Add tests and ensure they pass
スクリーンショット 2025-06-24 10 38 00

@zigzagdev zigzagdev requested a review from a team as a code owner June 24, 2025 01:37
@zigzagdev zigzagdev requested a review from paulinevos June 24, 2025 01:37
@zigzagdev zigzagdev changed the title **refactor: consolidate repetitive model instantiations across tests** refactor: consolidate repetitive model instantiations across tests Jun 24, 2025
@zigzagdev zigzagdev requested a review from GromNaN June 25, 2025 09:12
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.

2 participants