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

Fix of issue 218 #219

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Fix of issue 218 #219

wants to merge 6 commits into from

Conversation

mcosti
Copy link

@mcosti mcosti commented May 1, 2024

#218

This was the most backwards compatible way of implementing it that I could think of.

It works for my usecase scenario, but I am of course open to suggestions.

I would add testing but there are no tests involving Django models yet

@mcosti
Copy link
Author

mcosti commented May 1, 2024

It seems like the fix is not complete.

Somewhere in the partial function model_fixture, the regular fixture name is called, and if the clashing factory does not have the same parameter, it will fail like this:

file /opt/project/tests/finance/subscriptions/test_prices_checkout.py, line 17
  def test_cancel_subscription(subscription: Subscription):
file /usr/local/lib/python3.11/dist-packages/pytest_factoryboy/fixture.py, line 350
  def model_fixture(request: SubRequest, factory_name: str) -> Any:
file /usr/local/lib/python3.11/dist-packages/pytest_factoryboy/fixture.py, line 502
  def subfactory_fixture(request: SubRequest, factory_class: FactoryType) -> Any:
E       fixture 'customer__id' not found

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.

1 participant