🗃️(models) add MailDomain, MailDomainAccess and Mailbox models
Additional app and models to handle email addresses creation in Desk.
This commit is contained in:
committed by
Marie
parent
a1f9cf0854
commit
cca6c77f00
26
src/backend/mailbox_manager/tests/test_models_maildomain.py
Normal file
26
src/backend/mailbox_manager/tests/test_models_maildomain.py
Normal file
@@ -0,0 +1,26 @@
|
||||
"""
|
||||
Unit tests for the MailDomain model
|
||||
"""
|
||||
|
||||
from django.core.exceptions import ValidationError
|
||||
|
||||
import pytest
|
||||
|
||||
from mailbox_manager import factories
|
||||
|
||||
pytestmark = pytest.mark.django_db
|
||||
|
||||
|
||||
# NAME FIELD
|
||||
|
||||
|
||||
def test_models_mail_domain__domain_name_should_not_be_empty():
|
||||
"""The domain name field should not be empty."""
|
||||
with pytest.raises(ValidationError, match="This field cannot be blank"):
|
||||
factories.MailDomainFactory(name="")
|
||||
|
||||
|
||||
def test_models_mail_domain__domain_name_should_not_be_null():
|
||||
"""The domain name field should not be null."""
|
||||
with pytest.raises(ValidationError, match="This field cannot be null."):
|
||||
factories.MailDomainFactory(name=None)
|
||||
Reference in New Issue
Block a user