diff options
| author | Barry Warsaw | 2012-06-03 13:21:38 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2012-06-03 13:21:38 -0400 |
| commit | e1aa901fbdcc6d7fbb495a1d9ca1a5079008164a (patch) | |
| tree | 9146fed874216bfb88707848568d7598ec2e8522 /src/mailman/testing/layers.py | |
| parent | 847409ba333375bd9c168e28f15748e58970404f (diff) | |
| parent | 3c8a07fc76176a8ea89ee6b73aef571d0b2c81ed (diff) | |
| download | mailman-e1aa901fbdcc6d7fbb495a1d9ca1a5079008164a.tar.gz mailman-e1aa901fbdcc6d7fbb495a1d9ca1a5079008164a.tar.zst mailman-e1aa901fbdcc6d7fbb495a1d9ca1a5079008164a.zip | |
Diffstat (limited to 'src/mailman/testing/layers.py')
| -rw-r--r-- | src/mailman/testing/layers.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/mailman/testing/layers.py b/src/mailman/testing/layers.py index 41ef86935..0faa1c8e4 100644 --- a/src/mailman/testing/layers.py +++ b/src/mailman/testing/layers.py @@ -25,7 +25,7 @@ # eventually get rid of the zope.test* dependencies and use something like # testresources or some such. -from __future__ import absolute_import, unicode_literals +from __future__ import absolute_import, print_function, unicode_literals __metaclass__ = type __all__ = [ @@ -56,6 +56,7 @@ from mailman.config import config from mailman.core import initialize from mailman.core.initialize import INHIBIT_CONFIG_FILE from mailman.core.logging import get_handler +from mailman.database.transaction import transaction from mailman.interfaces.domain import IDomainManager from mailman.testing.helpers import ( TestableMaster, get_lmtp_client, reset_the_world) @@ -176,7 +177,7 @@ class ConfigLayer(MockAndMonkeyLayer): config_file = os.path.join(cls.var_dir, 'test.cfg') with open(config_file, 'w') as fp: fp.write(test_config) - print >> fp + print(file=fp) config.filename = config_file @classmethod @@ -189,10 +190,10 @@ class ConfigLayer(MockAndMonkeyLayer): @classmethod def testSetUp(cls): # Add an example domain. - getUtility(IDomainManager).add( - 'example.com', 'An example domain.', - 'http://lists.example.com', 'postmaster@example.com') - config.db.commit() + with transaction(): + getUtility(IDomainManager).add( + 'example.com', 'An example domain.', + 'http://lists.example.com', 'postmaster@example.com') @classmethod def testTearDown(cls): |
