Back to index

plone3  3.1.7
test_DiscussionTool.py
Go to the documentation of this file.
00001 ##############################################################################
00002 #
00003 # Copyright (c) 2002 Zope Corporation and Contributors. All Rights Reserved.
00004 #
00005 # This software is subject to the provisions of the Zope Public License,
00006 # Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
00007 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
00008 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00009 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
00010 # FOR A PARTICULAR PURPOSE.
00011 #
00012 ##############################################################################
00013 """ Unit tests for DiscussionTool module.
00014 
00015 $Id: test_DiscussionTool.py 68496 2006-06-05 16:30:18Z yuppie $
00016 """
00017 
00018 import unittest
00019 import Testing
00020 
00021 
00022 class DiscussionToolTests(unittest.TestCase):
00023 
00024     def test_z2interfaces(self):
00025         from Interface.Verify import verifyClass
00026         from Products.CMFCore.DiscussionTool import DiscussionTool
00027         from Products.CMFCore.interfaces.portal_actions \
00028                 import ActionProvider as IActionProvider
00029         from Products.CMFCore.interfaces.portal_discussion \
00030                 import oldstyle_portal_discussion as IOldstyleDiscussionTool
00031 
00032         verifyClass(IActionProvider, DiscussionTool)
00033         verifyClass(IOldstyleDiscussionTool, DiscussionTool)
00034 
00035     def test_z3interfaces(self):
00036         from zope.interface.verify import verifyClass
00037         from Products.CMFCore.DiscussionTool import DiscussionTool
00038         from Products.CMFCore.interfaces import IActionProvider
00039         from Products.CMFCore.interfaces import IOldstyleDiscussionTool
00040 
00041         verifyClass(IActionProvider, DiscussionTool)
00042         verifyClass(IOldstyleDiscussionTool, DiscussionTool)
00043 
00044 
00045 class OldDiscussableTests(unittest.TestCase):
00046 
00047     def test_z2interfaces(self):
00048         from Interface.Verify import verifyClass
00049         from Products.CMFCore.DiscussionTool import OldDiscussable
00050         from Products.CMFCore.interfaces.Discussions \
00051                 import OldDiscussable as IOldDiscussable
00052 
00053         verifyClass(IOldDiscussable, OldDiscussable)
00054 
00055     def test_z3interfaces(self):
00056         from zope.interface.verify import verifyClass
00057         from Products.CMFCore.DiscussionTool import OldDiscussable
00058         from Products.CMFCore.interfaces import IOldstyleDiscussable
00059 
00060         verifyClass(IOldstyleDiscussable, OldDiscussable)
00061 
00062 
00063 def test_suite():
00064     return unittest.TestSuite((
00065         unittest.makeSuite(DiscussionToolTests),
00066         unittest.makeSuite(OldDiscussableTests),
00067         ))
00068 
00069 if __name__ == '__main__':
00070     unittest.main(defaultTest='test_suite')