Skip to content
This repository has been archived by the owner on Mar 15, 2024. It is now read-only.

Commit

Permalink
Add workaround for old mail.outbox
Browse files Browse the repository at this point in the history
  • Loading branch information
pelme authored and mfa committed May 17, 2017
1 parent b3f2df9 commit b77c16e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,15 @@ Compatibility
removed. If you have relied on this to get an empty outbox for your
test, you should change tests to use the ``mailoutbox`` fixture instead.
See documentation of ``mailoutbox`` fixture for usage. If you try to
access mail.outbox directly, AssertionError will be raised.
access mail.outbox directly, AssertionError will be raised. If you
previously relied on the old behaviour and do not want to change your
tests, put this in your project conftest.py::

@pytest.fixture(autouse=True)
def clear_outbox():
from django.core import mail
mail.outbox = []


3.0.0
-----
Expand Down

0 comments on commit b77c16e

Please sign in to comment.