[CMF-checkins] CVS: CMF/CMFDefault/tests - test_Discussions.py:1.11.4.1
Florent Guillaume
fg@nuxeo.com
Sun, 4 Aug 2002 19:00:12 -0400
Update of /cvs-repository/CMF/CMFDefault/tests
In directory cvs.zope.org:/tmp/cvs-serv10512/CMFDefault/tests
Modified Files:
Tag: CMF-1_3-branch
test_Discussions.py
Log Message:
Merged changes from HEAD:
Improved tests to make the distinction between meta_type, portal_type
and the portal type's title.
=== CMF/CMFDefault/tests/test_Discussions.py 1.11 => 1.11.4.1 ===
from Products.CMFCore.tests.base.utils import \
has_path
-from Products.CMFCore.tests.base.dummy import \
- DummyFTI
+from Products.CMFCore.tests.base.dummy import DummyFTI
+from Products.CMFCore.tests.base.dummy import DummyContent
from Products.CMFCore.CatalogTool import CatalogTool
from Products.CMFCore.TypesTool import TypesTool
@@ -17,7 +17,6 @@
from Products.CMFDefault.DiscussionTool import \
DiscussionTool, DiscussionNotAllowed
-from Products.CMFDefault.Document import Document
from Products.CMFDefault.URLTool import URLTool
class DiscussionTests( SecurityTest ):
@@ -39,7 +38,7 @@
types_tool = self.types_tool = root.portal_types
try: root._delObject('test')
except AttributeError: pass
- root._setObject( 'test', Document( 'test' ) )
+ root._setObject( 'test', DummyContent( 'test', catalog=1 ) )
def test_policy( self ):
@@ -56,19 +55,20 @@
del test.talkback
del test.allow_discussion
- self.types_tool._setObject( 'Document', DummyFTI )
+ self.types_tool._setObject( 'Dummy Content', DummyFTI )
self.assertRaises( DiscussionNotAllowed
, self.discussion_tool.getDiscussionFor
, test
)
assert getattr( test, 'talkback', None ) is None
- self.types_tool.Document.allow_discussion = 1
+ ti = getattr(self.types_tool, 'Dummy Content')
+ ti.allow_discussion = 1
assert self.discussion_tool.getDiscussionFor( test )
assert test.talkback
del test.talkback
- self.types_tool.Document.allow_discussion = 0
+ ti.allow_discussion = 0
self.assertRaises( DiscussionNotAllowed
, self.discussion_tool.getDiscussionFor
, test