pytest-dev / pytest-dev/pytest-django
`mail.outbox` not being set?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 367
- PR merge metrics
- No merged PRs in 30d
Description
Hey there, thanks for pytest-django! Appreciate all of the hard work, have used it quite a few times with no problems.
We're running into a bit of a snag where we upgraded some things and suddenly mail.outbox isn't retaining emails during tests. I've tried to figure out how exactly to use the mailoutbox fixture as documented here but I am having trouble using this.
Right now we're testing in a class and I have tried quite a few configurations to pass mailoutbox fixture. I.e. I updated the ini:
[pytest]
usefixtures = mailoutbox
Not exactly sure how to use that fixture though, I tried adding the positional argument mailoutbox to my class methods, still not able to access it.. I am sure I am missing something simple.
Would appreciate a push in the right direction -- and again, thanks so much for this project!
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 with the mailoutbox fixture documentation linked in the issue and compare its usage with the class-based test methods and pytest.ini configuration described. Reproduce the reported behavior after the dependency upgrade, then determine whether the documented fixture usage works or whether the documentation needs clarification.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, python
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100