Author: rmarianski
Date: 2007-11-11 15:14:13 -0500 (Sun, 11 Nov 2007)
New Revision: 10897

Modified:
   opencore/trunk/opencore/listen/listen_discussion.txt
   opencore/trunk/opencore/listen/tests.py
Log:
add test to check for creating an auto discussion list with an address that is 
already registered

Modified: opencore/trunk/opencore/listen/listen_discussion.txt
===================================================================
--- opencore/trunk/opencore/listen/listen_discussion.txt        2007-11-11 
19:25:11 UTC (rev 10896)
+++ opencore/trunk/opencore/listen/listen_discussion.txt        2007-11-11 
20:14:13 UTC (rev 10897)
@@ -83,3 +83,24 @@
     Traceback (most recent call last):
     ...
     AttributeError: lists
+
+Creating the auto discussion list should fail silently
+if the mailing list address already exists
+
+We can reuse the testproj mailing list, and change the mailto
+    >>> ll = getUtility(IListLookup, context=self.portal)
+    >>> ml = proj.lists._getOb('testproj-discussion')
+
+XXX looks like there's an issue that removing the listen featurelet
+doesn't actually unregister the lists there
+this needs to be revisited for removing projects as well
+    >>> ll.unregisterList(ml)
+    >>> ml.mailto = 'p3-discussion'
+    >>> ll.registerList(ml)
+
+Now we should silently not create the mailing list
+    >>> IFeatureletSupporter(p3).installFeaturelet(ListenFeaturelet())
+    >>> p3.lists._getOb('p3-discussion')
+    Traceback (most recent call last):
+    ...
+    AttributeError: p3-discussion

Modified: opencore/trunk/opencore/listen/tests.py
===================================================================
--- opencore/trunk/opencore/listen/tests.py     2007-11-11 19:25:11 UTC (rev 
10896)
+++ opencore/trunk/opencore/listen/tests.py     2007-11-11 20:14:13 UTC (rev 
10897)
@@ -22,6 +22,8 @@
     from zope.interface import alsoProvides
     from pprint import pprint
     from opencore.nui.formhandler import test_suite as octotest
+    from zope.component import getUtility
+    from Products.listen.interfaces import IListLookup
     
     setup.setupPloneSite()
     def listen_discussion_setup(tc):



--
Archive: 
http://www.openplans.org/projects/opencore/lists/openplans-svn/archive/2007/11/1194812053991
To unsubscribe send an email with subject unsubscribe to [EMAIL PROTECTED]  
Please contact [EMAIL PROTECTED] for questions.

Reply via email to