hardcoded fti_title, don't query typestool for Type()
all tests succeed svn path=/plone.app.discussion/trunk/; revision=35290
This commit is contained in:
parent
f41c55cc8c
commit
5beebe42fa
@ -54,6 +54,8 @@ class Comment(CatalogAware, WorkflowAware, DynamicType, Traversable,
|
|||||||
implements(IComment)
|
implements(IComment)
|
||||||
|
|
||||||
meta_type = portal_type = 'Discussion Item'
|
meta_type = portal_type = 'Discussion Item'
|
||||||
|
# This needs to be kept in sync with types/Discussion_Item.xml title
|
||||||
|
fti_title = 'Comment'
|
||||||
|
|
||||||
__parent__ = None
|
__parent__ = None
|
||||||
|
|
||||||
@ -113,8 +115,7 @@ class Comment(CatalogAware, WorkflowAware, DynamicType, Traversable,
|
|||||||
def Type(self):
|
def Type(self):
|
||||||
"""The Discussion Item content type
|
"""The Discussion Item content type
|
||||||
"""
|
"""
|
||||||
ptypes = getToolByName(self, 'portal_types')
|
return self.fti_title
|
||||||
return ptypes[self.portal_type].title
|
|
||||||
|
|
||||||
# CMF's event handlers assume any IDynamicType has these :(
|
# CMF's event handlers assume any IDynamicType has these :(
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ class CommentTest(PloneTestCase):
|
|||||||
|
|
||||||
def test_type(self):
|
def test_type(self):
|
||||||
comment1 = createObject('plone.Comment')
|
comment1 = createObject('plone.Comment')
|
||||||
self.assertEquals(comment1.Type(), 'Discussion Item')
|
self.assertEquals(comment1.Type(), 'Comment')
|
||||||
|
|
||||||
def test_traversal(self):
|
def test_traversal(self):
|
||||||
# make sure comments are traversable, have an id, absolute_url and physical path
|
# make sure comments are traversable, have an id, absolute_url and physical path
|
||||||
@ -251,4 +251,4 @@ class RepliesTest(PloneTestCase):
|
|||||||
self.assertEquals('http://nohost/plone/doc1/++conversation++default/' + str(new_re_re_re_id), re_re_re_comment.absolute_url())
|
self.assertEquals('http://nohost/plone/doc1/++conversation++default/' + str(new_re_re_re_id), re_re_re_comment.absolute_url())
|
||||||
|
|
||||||
def test_suite():
|
def test_suite():
|
||||||
return unittest.defaultTestLoader.loadTestsFromName(__name__)
|
return unittest.defaultTestLoader.loadTestsFromName(__name__)
|
||||||
|
Loading…
Reference in New Issue
Block a user