Remove "Plone 3 only" code; Do not monkey patch the BAD_TYPES vocabulary or plone.app.vocabularies anymore.
svn path=/plone.app.discussion/trunk/; revision=47311
This commit is contained in:
@@ -71,15 +71,7 @@ class CommentTest(PloneTestCase):
|
||||
conversation.addComment(comment1)
|
||||
comment_brain = self.catalog.searchResults(
|
||||
portal_type = 'Discussion Item')[0]
|
||||
|
||||
# comment should only have a UID if plone.uuid is present
|
||||
try:
|
||||
from plone.uuid.interfaces import IUUID
|
||||
IUUID # pyflakes
|
||||
except ImportError:
|
||||
self.failIf(comment_brain.UID)
|
||||
else:
|
||||
self.failUnless(comment_brain.UID)
|
||||
self.failUnless(comment_brain.UID)
|
||||
|
||||
def test_uid_is_unique(self):
|
||||
conversation = IConversation(self.portal.doc1)
|
||||
@@ -89,11 +81,7 @@ class CommentTest(PloneTestCase):
|
||||
conversation.addComment(comment2)
|
||||
brains = self.catalog.searchResults(
|
||||
portal_type = 'Discussion Item')
|
||||
|
||||
# make sure uids are either both None (i.e. without plone.uuid),
|
||||
# or not equal
|
||||
if brains[0].UID != None or brains[1].UID != None:
|
||||
self.assertNotEquals(brains[0].UID, brains[1].UID)
|
||||
self.assertNotEquals(brains[0].UID, brains[1].UID)
|
||||
|
||||
def test_comment_uid_differs_from_content_uid(self):
|
||||
conversation = IConversation(self.portal.doc1)
|
||||
|
||||
@@ -680,14 +680,8 @@ class ConversationTest(PloneTestCase):
|
||||
|
||||
self.assertEquals(('', 'plone', 'doc1', '++conversation++default'),
|
||||
conversation.getPhysicalPath())
|
||||
# XXX: conversation.absolute_url() returns different values dependent
|
||||
# on the Plone version used.
|
||||
# Plone 3.3:
|
||||
#self.assertEquals('plone/doc1/%2B%2Bconversation%2B%2Bdefault',
|
||||
#conversation.absolute_url())
|
||||
# Plone 4:
|
||||
#self.assertEquals('http://nohost/plone/doc1/++conversation++default',
|
||||
#conversation.absolute_url())
|
||||
self.assertEquals('http://nohost/plone/doc1/++conversation++default',
|
||||
conversation.absolute_url())
|
||||
|
||||
def test_parent(self):
|
||||
# Check that conversation has a content object as parent
|
||||
@@ -701,7 +695,6 @@ class ConversationTest(PloneTestCase):
|
||||
|
||||
self.assertEquals(conversation.__parent__.getId(), 'doc1')
|
||||
|
||||
|
||||
def test_discussion_item_not_in_bad_types(self):
|
||||
self.failIf('Discussion Item' in BAD_TYPES)
|
||||
|
||||
|
||||
@@ -214,14 +214,8 @@ class TestModeratorNotificationUnit(PloneTestCase):
|
||||
self.failUnless(self.mailhost.messages[0])
|
||||
msg = self.mailhost.messages[0]
|
||||
|
||||
if not isinstance(msg, str):
|
||||
# Plone 3
|
||||
self.failUnless('portal@plone.test' in msg.mfrom)
|
||||
self.failUnless('portal@plone.test' in msg.mto)
|
||||
else:
|
||||
#Plone 4
|
||||
self.failUnless('To: portal@plone.test' in msg)
|
||||
self.failUnless('From: portal@plone.test' in msg)
|
||||
self.failUnless('To: portal@plone.test' in msg)
|
||||
self.failUnless('From: portal@plone.test' in msg)
|
||||
|
||||
#We expect the headers to be properly header encoded (7-bit):
|
||||
#>>> 'Subject: =?utf-8?q?Some_t=C3=A4st_subject=2E?=' in msg
|
||||
|
||||
Reference in New Issue
Block a user