summaryrefslogtreecommitdiff
path: root/src/mailman_pgp/styles
diff options
context:
space:
mode:
authorJ08nY2017-07-31 02:34:00 +0200
committerJ08nY2017-07-31 02:34:00 +0200
commita07fe54b768359360bbcd84ea04dfe204637849d (patch)
tree7bd8256b8173dac249dbc07c493e6f4bcddb72f4 /src/mailman_pgp/styles
parent6d87f5b0c8c7e7a3f71e0c5d5392201b4e4769ff (diff)
downloadmailman-pgp-a07fe54b768359360bbcd84ea04dfe204637849d.tar.gz
mailman-pgp-a07fe54b768359360bbcd84ea04dfe204637849d.tar.zst
mailman-pgp-a07fe54b768359360bbcd84ea04dfe204637849d.zip
Diffstat (limited to 'src/mailman_pgp/styles')
-rw-r--r--src/mailman_pgp/styles/tests/test_base.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mailman_pgp/styles/tests/test_base.py b/src/mailman_pgp/styles/tests/test_base.py
index d343fe4..6726d3a 100644
--- a/src/mailman_pgp/styles/tests/test_base.py
+++ b/src/mailman_pgp/styles/tests/test_base.py
@@ -18,6 +18,7 @@ from unittest import TestCase
from mailman.app.lifecycle import create_list
+from mailman_pgp.config import config
from mailman_pgp.model.list import PGPMailingList
from mailman_pgp.styles.base import PGPStyle
from mailman_pgp.testing.layers import PGPConfigLayer
@@ -42,3 +43,19 @@ class TestBaseStyle(TestCase):
# Test another apply doesn't fail
base_style.apply(mlist)
+
+ def test_autogenerate(self):
+ self.addCleanup(config.set, 'keypairs', 'autogenerate', 'no')
+ config.set('keypairs', 'autogenerate', 'yes')
+
+ # Create with default style.
+ mlist = create_list('test@example.com')
+ # Manually apply base PGPStyle.
+ base_style = PGPStyle()
+ base_style.apply(mlist)
+
+ pgp_list = PGPMailingList.for_list(mlist)
+
+ # Test that we have our PGPMailingList
+ self.assertIsNotNone(pgp_list)
+ self.assertIsNotNone(pgp_list.key)