pytest-dev / pytest-dev/pytest-bdd
How to add the ``django_db`` mark to automatically generated tests?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 251
- Avg merge
- 43m
- Merged PRs (30d)
- 2
Description
I keep getting this error from pytest-django:
Failed: Database access not allowed, use the "django_db" mark, or the "db" or "transactional_db" fixtures to enable it.
However, I don't know how to add the django_db mark to tests automatically created with the scenarios() function. Some sort of documentation on how to do this would be great.
I also suspect this is the underlying reason for #187.
Contributor guide
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 reading the scenarios() entry point and the discussion in issue #187 to understand how generated tests interact with pytest-django. Document how the django_db mark, db fixture, or transactional_db fixture can be applied to these tests, and verify the documented approach against the reported database-access error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100