- specify dependencies

- set profile version to 1 (profile version != package version)
- complete dict APIs and IReplies adapters (not yet fully tested)
- tidy up addComment() and __delitem__ w.r.t events
- sync interfaces with actual code
- move tests to use collective.testcaselayer

svn path=/plone.app.discussion/trunk/; revision=27010
This commit is contained in:
Martin Aspeli
2009-05-18 14:16:48 +00:00
parent b1c225176b
commit 22ae84735b
12 changed files with 317 additions and 147 deletions
-29
View File
@@ -1,29 +0,0 @@
import unittest
from zope.testing import doctestunit
from zope.component import testing, getMultiAdapter
from zope.publisher.browser import TestRequest
from zope.publisher.interfaces.browser import IBrowserView
from Testing import ZopeTestCase as ztc
from Products.Five import zcml
from Products.Five import fiveconfigure
from Products.PloneTestCase import PloneTestCase as ptc
from Products.PloneTestCase.layer import PloneSite
ptc.setupPloneSite(extension_profiles=['plone.app.discussion:default'])
import plone.app.discussion
class TestCase(ptc.PloneTestCase):
class layer(PloneSite):
@classmethod
def setUp(cls):
fiveconfigure.debug_mode = True
zcml.load_config('configure.zcml',
plone.app.discussion)
fiveconfigure.debug_mode = False
@classmethod
def tearDown(cls):
pass
+12
View File
@@ -0,0 +1,12 @@
from Products.PloneTestCase import ptc
import collective.testcaselayer.ptc
ptc.setupPloneSite()
class Layer(collective.testcaselayer.ptc.BasePTCLayer):
"""Install collective.flowplayer"""
def afterSetUp(self):
self.addProfile('plone.app.discussion:default')
DiscussionLayer = Layer([collective.testcaselayer.ptc.ptc_layer])
+7 -18
View File
@@ -1,23 +1,17 @@
import unittest
from datetime import datetime, timedelta
from base import TestCase
from zope.testing import doctestunit
from zope.component import testing, getMultiAdapter
from zope.publisher.browser import TestRequest
from zope.publisher.interfaces.browser import IBrowserView
from Testing import ZopeTestCase as ztc
from Products.Five import zcml
from Products.Five import fiveconfigure
from Products.PloneTestCase import PloneTestCase as ptc
from Products.PloneTestCase.layer import PloneSite
from Products.PloneTestCase.ptc import PloneTestCase
from plone.app.discussion.tests.layer import DiscussionLayer
from plone.app.discussion.conversation import Conversation
from plone.app.discussion.comment import Comment
from plone.app.discussion.interfaces import ICommentingTool, IConversation
class ConversationTest(TestCase):
class ConversationTest(PloneTestCase):
layer = DiscussionLayer
def afterSetUp(self):
# XXX If we make this a layer, it only get run once...
# First we need to create some content.
@@ -48,9 +42,4 @@ class ConversationTest(TestCase):
self.assert_(conversation.last_comment_date - datetime.now() < timedelta(seconds=1))
def test_suite():
return unittest.TestSuite([
unittest.makeSuite(ConversationTest),
])
if __name__ == '__main__':
unittest.main(defaultTest='test_suite')
return unittest.defaultTestLoader.loadTestsFromName(__name__)
+8 -20
View File
@@ -1,23 +1,17 @@
import unittest
from datetime import datetime, timedelta
from base import TestCase
from zope.testing import doctestunit
from zope.component import testing, getMultiAdapter, getUtility
from zope.publisher.browser import TestRequest
from zope.publisher.interfaces.browser import IBrowserView
from Testing import ZopeTestCase as ztc
from zope.component import getUtility
from Products.Five import zcml
from Products.Five import fiveconfigure
from Products.PloneTestCase import PloneTestCase as ptc
from Products.PloneTestCase.layer import PloneSite
from Products.PloneTestCase.ptc import PloneTestCase
from plone.app.discussion.tests.layer import DiscussionLayer
from plone.app.discussion.conversation import Conversation
from plone.app.discussion.comment import Comment
from plone.app.discussion.interfaces import ICommentingTool, IConversation
class ToolTest(TestCase):
class ToolTest(PloneTestCase):
layer = DiscussionLayer
def afterSetUp(self):
# XXX If we make this a layer, it only get run once...
# First we need to create some content.
@@ -46,12 +40,6 @@ class ToolTest(TestCase):
self.assert_(len(comment) == 1, "There is only one comment, but we got"
" %s results in the search" % len(comment))
self.assertEquals(comment[0].Title, 'Comment 1')
def test_suite():
return unittest.TestSuite([
unittest.makeSuite(ToolTest),
])
if __name__ == '__main__':
unittest.main(defaultTest='test_suite')
return unittest.defaultTestLoader.loadTestsFromName(__name__)