pep8
svn path=/plone.app.discussion/trunk/; revision=48840
This commit is contained in:
parent
6c14d5bf38
commit
5786bfa6b6
@ -15,6 +15,7 @@ from plone.app.discussion.tests.layer import DiscussionLayer
|
|||||||
|
|
||||||
from plone.app.discussion.interfaces import IConversation
|
from plone.app.discussion.interfaces import IConversation
|
||||||
|
|
||||||
|
|
||||||
class CatalogSetupTest(PloneTestCase):
|
class CatalogSetupTest(PloneTestCase):
|
||||||
|
|
||||||
layer = DiscussionLayer
|
layer = DiscussionLayer
|
||||||
@ -76,7 +77,7 @@ class ConversationCatalogTest(PloneTestCase):
|
|||||||
self.new_comment1_id = new_comment1_id
|
self.new_comment1_id = new_comment1_id
|
||||||
|
|
||||||
def test_total_comments(self):
|
def test_total_comments(self):
|
||||||
self.failUnless(self.doc1_brain.has_key('total_comments'))
|
self.failUnless('total_comments' in self.doc1_brain)
|
||||||
self.assertEquals(self.doc1_brain.total_comments, 1)
|
self.assertEquals(self.doc1_brain.total_comments, 1)
|
||||||
|
|
||||||
comment2 = createObject('plone.Comment')
|
comment2 = createObject('plone.Comment')
|
||||||
@ -97,7 +98,7 @@ class ConversationCatalogTest(PloneTestCase):
|
|||||||
self.assertEquals(doc1_brain.total_comments, 2)
|
self.assertEquals(doc1_brain.total_comments, 2)
|
||||||
|
|
||||||
def test_last_comment_date(self):
|
def test_last_comment_date(self):
|
||||||
self.failUnless(self.doc1_brain.has_key('last_comment_date'))
|
self.failUnless('last_comment_date' in self.doc1_brain)
|
||||||
self.assertEquals(self.doc1_brain.last_comment_date,
|
self.assertEquals(self.doc1_brain.last_comment_date,
|
||||||
datetime(2006, 9, 17, 14, 18, 12))
|
datetime(2006, 9, 17, 14, 18, 12))
|
||||||
|
|
||||||
@ -146,7 +147,7 @@ class ConversationCatalogTest(PloneTestCase):
|
|||||||
self.assertEquals(doc1_brain.last_comment_date, None)
|
self.assertEquals(doc1_brain.last_comment_date, None)
|
||||||
|
|
||||||
def test_commentators(self):
|
def test_commentators(self):
|
||||||
self.failUnless(self.doc1_brain.has_key('commentators'))
|
self.failUnless('commentators' in self.doc1_brain)
|
||||||
self.assertEquals(self.doc1_brain.commentators, ('Jim',))
|
self.assertEquals(self.doc1_brain.commentators, ('Jim',))
|
||||||
|
|
||||||
# add another comment with another author
|
# add another comment with another author
|
||||||
@ -201,6 +202,7 @@ class ConversationCatalogTest(PloneTestCase):
|
|||||||
self.assertEquals(comment1_brain.last_comment_date, None)
|
self.assertEquals(comment1_brain.last_comment_date, None)
|
||||||
self.assertEquals(comment1_brain.total_comments, None)
|
self.assertEquals(comment1_brain.total_comments, None)
|
||||||
|
|
||||||
|
|
||||||
class CommentCatalogTest(PloneTestCase):
|
class CommentCatalogTest(PloneTestCase):
|
||||||
|
|
||||||
layer = DiscussionLayer
|
layer = DiscussionLayer
|
||||||
@ -391,7 +393,7 @@ class NoConversationCatalogTest(PloneTestCase):
|
|||||||
self.doc1_brain = brains[0]
|
self.doc1_brain = brains[0]
|
||||||
|
|
||||||
def test_total_comments(self):
|
def test_total_comments(self):
|
||||||
self.failUnless(self.doc1_brain.has_key('total_comments'))
|
self.failUnless('total_comments' in self.doc1_brain)
|
||||||
self.assertEquals(self.doc1_brain.total_comments, 0)
|
self.assertEquals(self.doc1_brain.total_comments, 0)
|
||||||
|
|
||||||
# Make sure no conversation has been created
|
# Make sure no conversation has been created
|
||||||
|
Loading…
Reference in New Issue
Block a user