pytest-factoryboy
pytest-factoryboy copied to clipboard
Fix of issue 218
https://github.com/pytest-dev/pytest-factoryboy/issues/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
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