From 03bb57c8c2a47a08e19b20975622ebb2ef2b81c6 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Mon, 11 Jan 2016 22:52:33 -0500 Subject: Several optimizations: * Use `yield from` wherever appropriate. * Use SA's .one_or_none() where appropriate. - Fix a bug in MailingList.pass_extensions. - Use ValueError in other places for consistency. - Remove unreached/nonsense code. - Simplify the SubscriptionService.find_member() and .find_members() implementations. - Boost coverage. --- src/mailman/config/tests/test_configuration.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/mailman/config/tests/test_configuration.py') diff --git a/src/mailman/config/tests/test_configuration.py b/src/mailman/config/tests/test_configuration.py index 48cf21983..abbfce2c2 100644 --- a/src/mailman/config/tests/test_configuration.py +++ b/src/mailman/config/tests/test_configuration.py @@ -58,6 +58,21 @@ class TestConfiguration(unittest.TestCase): pass self.assertEqual(events, ['first', 'second', 'first']) + def test_config_template_dir_is_source(self): + fd, filename = tempfile.mkstemp() + self.addCleanup(os.remove, filename) + os.close(fd) + with open(filename, 'w') as fp: + print("""\ +[paths.here] +template_dir: :source: +""", file=fp) + config = Configuration() + config.load(filename) + import mailman.templates + self.assertEqual(config.TEMPLATE_DIR, + os.path.dirname(mailman.templates.__file__)) + class TestExternal(unittest.TestCase): -- cgit v1.2.3-70-g09d2