diff options
Diffstat (limited to 'src/mailman_pgp/styles/tests/test_base.py')
| -rw-r--r-- | src/mailman_pgp/styles/tests/test_base.py | 17 |
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) |
