django / django/channels

ChannelsLiveServerTestCase causes mail.outbox to always be empty

Open
#2,194 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
6.4k
Forks
826
PR merge metrics
No merged PRs in 30d

Description

If I take a test that asserts against the contents of `django.core.mail.outbox`, it will pass with `LiveServerTestCase` but fail with `ChannelsLiveServerTestCase`

Setting `EMAIL_BACKEND = "django.core.mail.backends.locmem.EmailBackend"` explicitly in my settings did not help.

Contributor guide

Open the contributing guide

Research direction

Start with the test that asserts against django.core.mail.outbox and reproduce the difference between LiveServerTestCase and ChannelsLiveServerTestCase. Then inspect how EMAIL_BACKEND and the locmem EmailBackend are configured during the Channels test. Done means the Channels test exposes the expected mail.outbox contents instead of leaving it empty.

Written by the indexing model from the issue text.

Assessment

Tech stack
django, python
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.