devnull@devnull is not considered a valid email address by django's EmailFieldValidator but it's a special address in dimail's config. Make "destination" a CharField instead of an EmailField to replace validator and add devnull to allowlist.
20 lines
414 B
Python
20 lines
414 B
Python
"""
|
|
Unit tests for the Alias model
|
|
"""
|
|
|
|
import pytest
|
|
|
|
from mailbox_manager import factories, models
|
|
|
|
pytestmark = pytest.mark.django_db
|
|
|
|
|
|
def test_models_aliases__devnull_destination_ok():
|
|
"""Can create alias where destination is devnull@devnull."""
|
|
|
|
models.Alias.objects.create(
|
|
local_part="spam",
|
|
domain=factories.MailDomainEnabledFactory(),
|
|
destination="devnull@devnull",
|
|
)
|