Back to index

plone3  3.1.7
test_construction.py
Go to the documentation of this file.
00001 import unittest
00002 from Products.Archetypes.tests.atsitetestcase import ATSiteTestCase
00003 
00004 
00005 class FactoryTest(ATSiteTestCase):
00006     def testSimplePortalType(self):
00007         self.folder.invokeFactory(id="dummy", type_name="SimpleType")
00008         self.assertEqual(self.folder.dummy.getPtype(), "Simple Type")
00009 
00010     def XXXtestCopiedFTIPortalType(self):
00011         # A known bug where `default_method` doesn't have the correct
00012         # portal type available.  For a discussion, see
00013         # https://dev.plone.org/plone/ticket/6734
00014         self.folder.invokeFactory(id="dummy", type_name="MySimpleType")
00015         self.assertEqual(self.folder.dummy.getPtype(), "My Simple Type")
00016 
00017 def test_suite():
00018     suite=unittest.TestSuite()
00019     suite.addTest(unittest.makeSuite(FactoryTest))
00020     return suite