diff --git a/src/apps/config/tests/test_security_material.py b/src/apps/config/tests/test_security_material.py index 35a656a..27f8377 100644 --- a/src/apps/config/tests/test_security_material.py +++ b/src/apps/config/tests/test_security_material.py @@ -136,8 +136,9 @@ class MailSecurityMaterialTest(unittest.TestCase): dkim_key_directory=str(paths.dkim_dir), outbound_ipv4="192.0.2.5", mail_dns={"example.test": { - "spf": [], "dkim": [], - "dmarc": ["v=DMARC1; p=none; pct=25"], "errors": [], + "spf": ["v=spf1 mx -all", "v=spf1 -all"], "dkim": [], + "dmarc": ["v=DMARC1; p=none; pct=25"], + "errors": ["temporary DNS failure"], }}, ) with mock.patch( @@ -166,6 +167,11 @@ class MailSecurityMaterialTest(unittest.TestCase): "v=spf1 ip4:192.0.2.5 -all") self.assertTrue(any(action.get("reason", "").startswith("pct") for action in results[0].actions)) + self.assertTrue(any(action.get("reason") == + "multiple SPF records are invalid" + for action in results[0].actions)) + self.assertTrue(any(action.get("action") == "retry-dns-check" + for action in results[0].actions)) self.assertEqual(repeated[0].suggested, results[0].suggested) self.assertEqual(repeated[0].actions, results[0].actions) generate.assert_called_once_with("example.test", "bongo")