Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
plone.app.portlets.tests.test_exportimport.TestImportPortlets Class Reference
Inheritance diagram for plone.app.portlets.tests.test_exportimport.TestImportPortlets:
Inheritance graph
[legend]
Collaboration diagram for plone.app.portlets.tests.test_exportimport.TestImportPortlets:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def test_removePortlet
def test_checkBasicPortletNodeErrors
def test_modifyForList
def test_initPortletNode_duplicateInterfaces
def test_initPortletNode_basic
def disabled_test_initPortletNode_i18n
def test_initPortletNode_multipleInterfaces
def test_initPortletNode_defaultManagerInterface
def test_initPortletNode_BBBInterface
def test_initPortletNode_extend
def test_initPortletNode_purge
def test_initPortletNode_remove
def afterSetUp

Public Attributes

 sm
 importer
 exporter

Detailed Description

Definition at line 45 of file test_exportimport.py.


Member Function Documentation

Definition at line 25 of file test_exportimport.py.

00025 
00026     def afterSetUp(self):
00027         setHooks()
00028         setSite(self.portal)
00029         self.sm = getSiteManager(self.portal)
00030         self.importer = self.exporter = PortletsXMLAdapter(self.sm,
00031           DummySetupEnviron())
   

Here is the call graph for this function:

Definition at line 102 of file test_exportimport.py.

00102 
00103     def disabled_test_initPortletNode_i18n(self):
00104         node = parseString(_XML_BASIC_I18N).documentElement
00105         self.importer._initPortletNode(node)
00106         portlet = queryUtility(IPortletType, name="portlets.New")
00107         self.failUnless(portlet is not None)
00108         self.assertEqual([IColumn], portlet.for_)
00109         # XXX Missing i18n support in the exportimport code
00110         self.failUnless(isinstance(portlet.title, Message),
00111                         "Portlet title should be a Message instance")
00112         self.failUnless(isinstance(portlet.description, Message),
00113                         "Portlet description should be a Message instance")
00114         self.assertEquals(u"title_foo_portlet", portlet.title)
00115         self.assertEquals(u"description_foo_portlet", portlet.description)
00116         self.assertEquals(u"Foo", portlet.title.default)
00117         self.assertEquals(u"Bar", portlet.description.default)
00118         self.assertEquals(u"foodomain", portlet.title.domain)
00119         self.assertEquals(u"foodomain", portlet.description.domain)

Definition at line 56 of file test_exportimport.py.

00056 
00057     def test_checkBasicPortletNodeErrors(self):
00058         node = parseString(_XML_INVALID_EXTEND_AND_PURGE).documentElement
00059         self.assertEqual(
00060           True, self.importer._checkBasicPortletNodeErrors(node,
00061           ['portlets.Exists'])
00062           ) 
00063         node = parseString(_XML_INVALID_EXTEND_NONEXISTS).documentElement
00064         self.assertEqual(
00065           True, self.importer._checkBasicPortletNodeErrors(node,
00066           ['portlets.Exists'])
00067           )
00068         node = parseString(_XML_INVALID_ADD_EXISTING).documentElement
00069         self.assertEqual(
00070           True, self.importer._checkBasicPortletNodeErrors(node,
00071           ['portlets.Exists'])
00072           )
00073         node = parseString(_XML_EXTEND_EXISTING).documentElement
00074         self.assertEqual(
00075           False, self.importer._checkBasicPortletNodeErrors(node,
00076           ['portlets.Exists'])
00077           )        
    

Definition at line 93 of file test_exportimport.py.

00093 
00094     def test_initPortletNode_basic(self):
00095         node = parseString(_XML_BASIC).documentElement
00096         self.importer._initPortletNode(node)
00097         portlet = queryUtility(IPortletType, name="portlets.New")
00098         self.failUnless(portlet is not None)
00099         self.assertEqual('Foo', portlet.title)
00100         self.assertEqual('Bar', portlet.description)
00101         self.assertEqual([IColumn], portlet.for_)

Definition at line 134 of file test_exportimport.py.

00134 
00135     def test_initPortletNode_BBBInterface(self):
00136         node = parseString(_XML_BBB_INTERFACE).documentElement
00137         self.importer._initPortletNode(node)
00138         portlet = queryUtility(IPortletType, name="portlets.BBB")
00139         self.failUnless(portlet is not None)
00140         self.assertEqual([IColumn], portlet.for_)
    

Definition at line 127 of file test_exportimport.py.

00127 
00128     def test_initPortletNode_defaultManagerInterface(self):
00129         node = parseString(_XML_DEFAULT_INTERFACE).documentElement
00130         self.importer._initPortletNode(node)
00131         portlet = queryUtility(IPortletType, name="portlets.New")
00132         self.failUnless(portlet is not None)
00133         self.assertEqual([Interface], portlet.for_)
    

Definition at line 86 of file test_exportimport.py.

00086 
00087     def test_initPortletNode_duplicateInterfaces(self): 
00088         node = parseString(_XML_DUPLICATE_INTERFACES).documentElement 
00089         self.importer._initPortletNode(node) 
00090         portlet = queryUtility(IPortletType, name="portlets.New") 
00091         self.failUnless(portlet is not None) 
00092         self.assertEqual([IColumn], portlet.for_) 
    

Definition at line 141 of file test_exportimport.py.

00141 
00142     def test_initPortletNode_extend(self):
00143         node = parseString(_XML_EXTENDME_SETUP).documentElement
00144         self.importer._initPortletNode(node)
00145         node = parseString(_XML_EXTENDME_EXTENSION).documentElement
00146         self.importer._initPortletNode(node) 
00147         portlet = queryUtility(IPortletType, name="portlets.ExtendMe")
00148         self.failUnless(portlet is not None)
00149         self.assertEqual([IDashboard], portlet.for_)
00150         self.assertEqual('Bar', portlet.title)
00151         self.assertEqual('Bar', portlet.description)
    

Definition at line 120 of file test_exportimport.py.

00120 
00121     def test_initPortletNode_multipleInterfaces(self):
00122         node = parseString(_XML_MULTIPLE_INTERFACES).documentElement
00123         self.importer._initPortletNode(node)
00124         portlet = queryUtility(IPortletType, name="portlets.New")
00125         self.failUnless(portlet is not None)
00126         self.assertEqual([IColumn, IDashboard], portlet.for_)
    

Definition at line 152 of file test_exportimport.py.

00152 
00153     def test_initPortletNode_purge(self):
00154         node = parseString(_XML_PURGEME_SETUP).documentElement
00155         self.importer._initPortletNode(node)
00156         node = parseString(_XML_PURGEME_PURGE).documentElement
00157         self.importer._initPortletNode(node)
00158         portlet = queryUtility(IPortletType, name="portlets.PurgeMe")
00159         self.failUnless(portlet is not None)
00160         self.assertEqual([IColumn], portlet.for_)
00161         self.assertEqual('Bar', portlet.title)
00162         self.assertEqual('Bar', portlet.description)
    

Definition at line 163 of file test_exportimport.py.

00163 
00164     def test_initPortletNode_remove(self):
00165         node = parseString(_XML_REMOVEME_SETUP).documentElement
00166         self.importer._initPortletNode(node)
00167         portlet = queryUtility(IPortletType, name='portlets.RemoveMe')
00168         self.failUnless(portlet is not None)
00169         node = parseString(_XML_REMOVEME_REMOVE).documentElement
00170         self.importer._initPortletNode(node)
00171         portlet = queryUtility(IPortletType, name='portlets.RemoveMe')
00172         self.failUnless(portlet is None)

Definition at line 78 of file test_exportimport.py.

00078 
00079     def test_modifyForList(self):
00080         node = parseString(_XML_SWITCH_COLUMNS).documentElement
00081         self.assertEqual([IColumn],
00082           self.importer._modifyForList(node, [IDashboard]))
00083         node = parseString(_XML_BBB_INTERFACE).documentElement
00084         self.assertEqual([IColumn],
00085           self.importer._modifyForList(node, []))
    

Definition at line 47 of file test_exportimport.py.

00047 
00048     def test_removePortlet(self):
00049         self.failUnless(queryUtility(IPortletType,
00050           name='portlets.Calendar') is not None)
00051         self.assertEqual(True,
00052           self.importer._removePortlet('portlets.Calendar'))
00053         self.failUnless(queryUtility(IPortletType,
00054           name='portlets.Calendar') is None)
00055         self.assertEqual(False, self.importer._removePortlet('foo'))
    

Member Data Documentation

Definition at line 29 of file test_exportimport.py.

Definition at line 29 of file test_exportimport.py.

Definition at line 28 of file test_exportimport.py.


The documentation for this class was generated from the following file: