From 1cc02a3acd1b3b41fd0c22073ce289aed286d17d Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Wed, 24 Jun 2009 08:25:11 +0000 Subject: [PATCH] Type() is meant to be a method not an attribute. svn path=/plone.app.discussion/trunk/; revision=27652 --- plone/app/discussion/comment.py | 7 ++++++- plone/app/discussion/tests/test_comment.py | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/plone/app/discussion/comment.py b/plone/app/discussion/comment.py index f79d400..dac227b 100644 --- a/plone/app/discussion/comment.py +++ b/plone/app/discussion/comment.py @@ -24,7 +24,7 @@ class Comment(DynamicType, Traversable, RoleManager, Owned, Implicit): implements(IComment) - meta_type = portal_type = Type = 'Discussion Item' + meta_type = portal_type = 'Discussion Item' __parent__ = None @@ -75,6 +75,11 @@ class Comment(DynamicType, Traversable, RoleManager, Owned, Implicit): """ return self.creator + def Type(self): + """The Discussion Item content type + """ + return "Discussion Item" + # CMF's event handlers assume any IDynamicType has these :( def opaqueItems(self): diff --git a/plone/app/discussion/tests/test_comment.py b/plone/app/discussion/tests/test_comment.py index 98a2540..e3b00ef 100644 --- a/plone/app/discussion/tests/test_comment.py +++ b/plone/app/discussion/tests/test_comment.py @@ -45,7 +45,7 @@ class CommentTest(PloneTestCase): def test_type(self): comment1 = createObject('plone.Comment') - self.assertEquals(comment1.Type, 'Discussion Item') + self.assertEquals(comment1.Type(), 'Discussion Item') def test_traversal(self): # make sure comments are traversable, have an id, absolute_url and physical path