Exemple #1
0
 def afterSetUp(self):
     from Products.Naaya.NyFolder import addNyFolder
     from Products.NaayaContent.NyPointer.NyPointer import addNyPointer
     addNyFolder(self.portal, 'myfolder', contributor='contributor', submitted=1)
     addNyPointer(self.portal.myfolder, id='mypointer', title='My pointer',
         pointer='http://www.eaudeweb.ro', submitted=1, contributor='contributor')
     import transaction; transaction.commit()
Exemple #2
0
 def test_main(self):
     """ Add, Find, Edit and Delete Naaya Pointers """
     #add NyPointer
     addNyPointer(self._portal().info, id='pointer1', title='pointer1', lang='en')
     addNyPointer(self._portal().info, id='pointer1_fr', title='pointer1_fr', lang='fr')
     
     meta = self._portal().getCatalogedObjectsCheckView(meta_type=['Naaya Pointer'])
     
     #get added NyPointer
     for x in meta:
         if x.getLocalProperty('title', 'en') == 'pointer1':
             meta = x
         if x.getLocalProperty('title', 'fr') == 'pointer1_fr':
             meta_fr = x
     
     self.assertEqual(meta.getLocalProperty('title', 'en'), 'pointer1')
     self.assertEqual(meta_fr.getLocalProperty('title', 'fr'), 'pointer1_fr')
     
     #change NyPointer title
     meta.saveProperties(title='pointer1_edited', lang='en')
     meta_fr.saveProperties(title='pointer1_fr_edited', lang='fr')
     
     self.assertEqual(meta.getLocalProperty('title', 'en'), 'pointer1_edited')
     self.assertEqual(meta_fr.getLocalProperty('title', 'fr'), 'pointer1_fr_edited')
     
     #delete NyPointer
     self._portal().info.manage_delObjects([meta.id])
     self._portal().info.manage_delObjects([meta_fr.id])
     
     meta = self._portal().getCatalogedObjectsCheckView(meta_type=['Naaya Pointer'])
     self.assertEqual(meta, [])
Exemple #3
0
    def test_NyPointer(self):
        """ Add, Find, Edit and Delete Naaya Pointers """
        #add NyPointer
        addNyPointer(self.portal.folder_test,
                     id='pointer1',
                     title='pointer1',
                     lang='en')
        addNyPointer(self.portal.folder_test,
                     id='pointer1_fr',
                     title='pointer1_fr',
                     lang='fr')

        meta = self.portal.getCatalogedObjectsCheckView(
            meta_type=['Naaya Pointer'])

        #get added NyPointer
        for x in meta:
            if x.getLocalProperty('title', 'en') == 'pointer1':
                meta = x
            if x.getLocalProperty('title', 'fr') == 'pointer1_fr':
                meta_fr = x

        self.assertEqual(meta.getLocalProperty('title', 'en'), 'pointer1')
        self.assertEqual(meta_fr.getLocalProperty('title', 'fr'),
                         'pointer1_fr')

        #change NyPointer title
        meta.saveProperties(title='pointer1_edited', lang='en')
        meta_fr.saveProperties(title='pointer1_fr_edited', lang='fr')

        self.assertEqual(meta.getLocalProperty('title', 'en'),
                         'pointer1_edited')
        self.assertEqual(meta_fr.getLocalProperty('title', 'fr'),
                         'pointer1_fr_edited')

        #delete NyPointer
        self.portal.folder_test.manage_delObjects([meta.id])
        self.portal.folder_test.manage_delObjects([meta_fr.id])

        meta = self.portal.getCatalogedObjectsCheckView(
            meta_type=['Naaya Pointer'])
        self.assertEqual(meta, [])
Exemple #4
0
 def afterSetUp(self):
     portal = self.app.portal
     addNyFolder(portal, 'test_folder')
     addNyPointer(portal.test_folder, id='test_pointer', title='Test pointer')