mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-18 05:51:26 +02:00
fixed mistake, updated test with real response possibility
This commit is contained in:
@@ -81,7 +81,7 @@ class CheckMXRecords(BaseCommand):
|
||||
result = socket.gethostbyname(pattern)
|
||||
#result from dnsbl is in ipv4 format
|
||||
splited_result = result.split(".")
|
||||
if int(splited_result[-1]) <= 15:
|
||||
if int(splited_result[-1]) > 15:
|
||||
#Typical dnsbl result : 127.0.0.[1-15] (depends on services)
|
||||
result = False
|
||||
except socket.gaierror:
|
||||
|
||||
@@ -217,7 +217,7 @@ class DNSBLTestCase(ModoTestCase):
|
||||
"""Check notifications."""
|
||||
mock_query.side_effect = utils.mock_dns_query_result
|
||||
mock_getaddrinfo.side_effect = utils.mock_ip_query_result
|
||||
mock_g_gethostbyname.return_value = "1.2.3.4"
|
||||
mock_g_gethostbyname.return_value = "127.0.0.4"
|
||||
management.call_command(
|
||||
"modo", "check_mx", "--email", "user@example.test")
|
||||
self.assertEqual(len(mail.outbox), 2)
|
||||
|
||||
Reference in New Issue
Block a user