(domains) define domain check interval as a settings

For now, to avoid overloading dimail, we have defined a
time interval between each check request to dimail.
This interval should be configurable for testing and
different environments.
This commit is contained in:
Sabrina Demagny
2025-03-21 18:38:41 +01:00
parent 7dac39034a
commit feb5d7154b
4 changed files with 13 additions and 1 deletions

View File

@@ -5,6 +5,8 @@ Unit tests for mailbox manager tasks.
import json
import re
from django.test import override_settings
import pytest
import responses
@@ -15,6 +17,7 @@ from .fixtures.dimail import CHECK_DOMAIN_BROKEN_INTERNAL, CHECK_DOMAIN_OK
pytestmark = pytest.mark.django_db
@override_settings(MAIL_CHECK_DOMAIN_INTERVAL=0)
@responses.activate
def test_fetch_domain_status_task_success(): # pylint: disable=too-many-locals
"""Test fetch domain status from dimail task"""
@@ -78,6 +81,7 @@ def test_fetch_domain_status_task_success(): # pylint: disable=too-many-locals
assert domain_disabled.status == enums.MailDomainStatusChoices.DISABLED
@override_settings(MAIL_CHECK_DOMAIN_INTERVAL=0)
@responses.activate
def test_fetch_domains_status_error_handling(caplog):
"""Test fetch domain status from dimail task with error"""