pytest-dev / pytest-dev/pytest-factoryboy
Registered Django factories don't call overridden classmethod _create
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 400
- Forks
- 44
- Avg merge
- 6h 34m
- Merged PRs (30d)
- 1
Description
It seems only the _create of the parent class (factory.django.DjangoModelFactory._create) is called when using a pytest-factoryboy fixture in a test. Using the Factory() class directly works fine (does indeed call the Factory._create classmethod).
I'll try to add a test case, but it will require adding a bunch of new requirements if we want to test it for a real Django model factory.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the difference between a registered pytest-factoryboy fixture and direct Factory() use, focusing on which _create classmethod is invoked. Add a regression test for the overridden classmethod; the issue notes that testing with a real Django model factory may require additional requirements.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, python
- Domain
- backend, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100