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

♻️(backend) rework factories #510

Open
kernicPanel opened this issue Dec 7, 2023 · 0 comments
Open

♻️(backend) rework factories #510

kernicPanel opened this issue Dec 7, 2023 · 0 comments

Comments

@kernicPanel
Copy link
Member

Bug Report

There is something weird here about the ContractFactory...

Instead of

order = factories.OrderFactory(product=product, owner=owner, contract=factories.ContractFactory())

this will work

order = factories.OrderFactory(product=product, owner=owner)
factories.ContractFactory(order=order)

Indeed, the ContractFactory uses a SubFactory to generate its related order.
So with your statement, the Contract is generated before the order so another Order is created before and linked to the Contract ...

To resume what's wrong, here it is a statement that will return True :

order.contract.order != order

Originally posted by @jbpenrath in #489 (comment)

@kernicPanel kernicPanel mentioned this issue Dec 7, 2023
4 tasks
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

No branches or pull requests

1 participant