diff --git a/plone/app/discussion/configure.zcml b/plone/app/discussion/configure.zcml index 97c29a6..921eba2 100644 --- a/plone/app/discussion/configure.zcml +++ b/plone/app/discussion/configure.zcml @@ -1,15 +1,29 @@ - + + + + - + diff --git a/plone/app/discussion/conversation.py b/plone/app/discussion/conversation.py index 101049d..7e4a0a7 100644 --- a/plone/app/discussion/conversation.py +++ b/plone/app/discussion/conversation.py @@ -10,7 +10,7 @@ manipulating the comments directly in reply to a particular comment or at the top level of the conversation. """ -from persistence import Persistent +from persistent import Persistent from zope.interface import implements, implementer from zope.component import adapts, adapter diff --git a/plone/app/discussion/tests/base.py b/plone/app/discussion/tests/base.py new file mode 100644 index 0000000..98a2c0c --- /dev/null +++ b/plone/app/discussion/tests/base.py @@ -0,0 +1,29 @@ +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 + diff --git a/plone/app/discussion/tests/test_api.py b/plone/app/discussion/tests/test_api.py new file mode 100644 index 0000000..300354e --- /dev/null +++ b/plone/app/discussion/tests/test_api.py @@ -0,0 +1,34 @@ +import unittest + +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 + +class APITest(TestCase): + def afterSetUp(self): + # XXX If we make this a layer, it only get run once... + # First we need to create some content. + self.loginAsPortalOwner() + typetool = self.portal.portal_types + typetool.constructContent('Document', self.portal, 'doc1') + + def test_test(self): + raise NotImplementedError + + +def test_suite(): + return unittest.TestSuite([ + unittest.makeSuite(APITest), + ]) + +if __name__ == '__main__': + unittest.main(defaultTest='test_suite')