Update of /cvsroot/mailman/mailman3/src/mailman/tests
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23179
Modified Files:
test_profile.py
Log Message:
Use the new ConfigTestBase class for simplified testing.
Index: test_profile.py
===================================================================
RCS file: /cvsroot/mailman/mailman3/src/mailman/tests/test_profile.py,v
retrieving revision 3.1
retrieving revision 3.2
diff -u -d -r3.1 -r3.2
--- test_profile.py 1 May 2004 02:46:24 -0000 3.1
+++ test_profile.py 1 May 2004 17:38:35 -0000 3.2
@@ -14,47 +14,32 @@
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
# Place - Suite 330, Boston, MA 02111-1307, USA.
-""" test backend ops on any backend which implements IProfile
-"""
+"""Test profile creation."""
-import os
import unittest
from mailman.dbmgr import dbmgr
-from mailman.config import configuration
-from mailman import startup
-
+from mailman.tests.basetest import ConfigTestBase
from mailman.interfaces.profile import DeliveryMode
-class TestProfile(unittest.TestCase):
-
+class TestProfile(ConfigTestBase):
def setUp(self):
- self._addr = '[EMAIL PROTECTED]'
+ ConfigTestBase.setUp(self)
+ self._addr = '[EMAIL PROTECTED]'
self._domain = 'myTestDomain'
def test_create_profile(self):
eq = self.assertEqual
- unless = self.failUnless
- # create a new blank profile, and check to see that the
- # default values for mode are correct
+ # Create a new blank profile, and check to see that the default values
+ # for mode are correct.
profile = dbmgr.users.create_profile(self._domain)
eq(profile.mode, DeliveryMode.Regular)
-
+
+
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestProfile))
return suite
-
-if __name__ == '__main__':
- here = os.path.abspath(os.path.dirname(__file__))
- mmroot = os.path.normpath(os.path.join(here, '../../..'))
- conffile = os.path.normpath(os.path.join(mmroot,
- 'etc/backendtest.conf'))
- configuration.configure(conffile)
- # after the above line, dbmgr should know about our backend.
- # now call everyone's initializer
- startup.startup()
- unittest.main()
_______________________________________________
Mailman-checkins mailing list
[EMAIL PROTECTED]
Unsubscribe: http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org