Author: barry.warsaw
Date: Tue Mar 22 16:01:03 2005
New Revision: 62
Added:
trunk/mailman/src/mailman/tests/
trunk/mailman/src/mailman/tests/__init__.py
trunk/mailman/src/mailman/tests/test_app_mlist.py
Modified:
trunk/mailman/src/mailman/database/tests/test_mlist.py
Log:
Move the application-level MailingList tests up to the right directory.
Modified: trunk/mailman/src/mailman/database/tests/test_mlist.py
==============================================================================
--- trunk/mailman/src/mailman/database/tests/test_mlist.py (original)
+++ trunk/mailman/src/mailman/database/tests/test_mlist.py Tue Mar 22
16:01:03 2005
@@ -85,32 +85,6 @@
eq(mlist.is_locked('max_hold'), False)
- def test_attribute_setting(self):
- eq = self.assertEqual
- defaultsgroup = AttributeGroup(collection_name='default') # Site-wide
defaults
- domaingroup = AttributeGroup(collection_name='localhost') #
Domain-wide defaults
- from mailman.mlist import MailingList
- mlist = MailingList('[EMAIL PROTECTED]')
- attr = Attribute(name='max_hold',
- type='NUMBER',
- default_value='10')
- eq(mlist.max_hold, '10')
- mlist.max_hold = '50'
- eq(mlist.max_hold, '50')
- # Check the database table also
- values = list(AttributeValue.select(
- (AttributeValue.q.name == 'max_hold') & \
- (AttributeValue.q.groupID ==
AttributeGroup.byCollection_name(mlist._mlist.name).id)))
- # Note: The mlist._mlist.name above was originally mlist.name, because
- # I had forgotten that I was using the MailingList object from mlist.py
- # (I thought it was the one from schema.py). This needs to be fixed:
- # the schema object and the "main" object should not have such similar
- # and confusing names. Think about this one...
- eq(len(values), 1)
- eq(values[0].value, '50')
-
-
-
def test_suite():
suite = unittest.TestSuite()
Added: trunk/mailman/src/mailman/tests/__init__.py
==============================================================================
Added: trunk/mailman/src/mailman/tests/test_app_mlist.py
==============================================================================
--- (empty file)
+++ trunk/mailman/src/mailman/tests/test_app_mlist.py Tue Mar 22 16:01:03 2005
@@ -0,0 +1,58 @@
+# Copyright (C) 2005 Barry A. Warsaw
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place - Suite 330, Boston, MA 02111-1307, USA.
+
+import datetime
+import unittest
+
+from mailman.database.schema import *
+from mailman.database.tests.base import DatabaseTest
+from mailman.mlist import MailingList
+
+
+
+class TestApplicationMailingList(DatabaseTest):
+ def test_attribute_setting(self):
+ eq = self.assertEqual
+ # Site-wide defaults
+ defaultsgroup = AttributeGroup(collection_name='default')
+ # Domain-wide defaults
+ domaingroup = AttributeGroup(collection_name='localhost')
+ mlist = MailingList('[EMAIL PROTECTED]')
+ attr = Attribute(name='max_hold',
+ type='NUMBER',
+ default_value='10')
+ eq(mlist.max_hold, '10')
+ mlist.max_hold = '50'
+ eq(mlist.max_hold, '50')
+ # Check the database table also
+ values = list(AttributeValue.select(
+ (AttributeValue.q.name == 'max_hold') & \
+ (AttributeValue.q.groupID ==
+ AttributeGroup.byCollection_name(mlist._mlist.name).id)))
+ # Note: The mlist._mlist.name above was originally mlist.name, because
+ # I had forgotten that I was using the MailingList object from
+ # mlist.py (I thought it was the one from schema.py). This needs to be
+ # fixed: the schema object and the "main" object should not have such
+ # similar and confusing names. Think about this one...
+ eq(len(values), 1)
+ eq(values[0].value, '50')
+
+
+
+def test_suite():
+ suite = unittest.TestSuite()
+ suite.addTest(unittest.makeSuite(TestApplicationMailingList))
+ return suite
_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe:
http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org