Matej Cepl
6a54bccfb6
- Add autoclear_mailbox.patch checking for the existence of the mail.outbox before clearing it (gh#pytest-dev/pytest-django#993). OBS-URL: https://build.opensuse.org/request/show/956874 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:django/python-pytest-django?expand=0&rev=30
17 lines
368 B
Diff
17 lines
368 B
Diff
---
|
|
pytest_django/plugin.py | 3 ++-
|
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
|
--- a/pytest_django/plugin.py
|
|
+++ b/pytest_django/plugin.py
|
|
@@ -502,7 +502,8 @@ def _dj_autoclear_mailbox() -> None:
|
|
|
|
from django.core import mail
|
|
|
|
- del mail.outbox[:]
|
|
+ if hasattr(mail, "outbox"):
|
|
+ del mail.outbox[:]
|
|
|
|
|
|
@pytest.fixture(scope="function")
|