Exemple #1
0
 def test_main(self):
     """ Add, Find, Edit and Delete Naaya Stories """
     #add NyStory
     addNyStory(self._portal().info, id='story1', title='story1', lang='en', submitted=1)
     addNyStory(self._portal().info, id='story1_fr', title='story1_fr', lang='fr', submitted=1)
     
     meta = self._portal().getCatalogedObjectsCheckView(meta_type=['Naaya Story'])
     
     #get added NyStory
     for x in meta:
         if x.getLocalProperty('title', 'en') == 'story1':
             meta = x
         if x.getLocalProperty('title', 'fr') == 'story1_fr':
             meta_fr = x
     
     self.assertEqual(meta.getLocalProperty('title', 'en'), 'story1')
     self.assertEqual(meta_fr.getLocalProperty('title', 'fr'), 'story1_fr')
     
     #change NyStory title
     meta.saveProperties(title='story1_edited', lang='en')
     meta_fr.saveProperties(title='story1_fr_edited', lang='fr')
     
     self.assertEqual(meta.getLocalProperty('title', 'en'), 'story1_edited')
     self.assertEqual(meta_fr.getLocalProperty('title', 'fr'), 'story1_fr_edited')
     
     #delete NyStory
     self._portal().info.manage_delObjects([meta.id])
     self._portal().info.manage_delObjects([meta_fr.id])
     
     meta = self._portal().getCatalogedObjectsCheckView(meta_type=['Naaya Story'])
     self.assertEqual(meta, [])
Exemple #2
0
    def test_NyStory(self):
        """ Add, Find, Edit and Delete Naaya Stories """
        #add NyStory
        addNyStory(self.portal.folder_test,
                   id='story1',
                   title='story1',
                   lang='en',
                   submitted=1)
        addNyStory(self.portal.folder_test,
                   id='story1_fr',
                   title='story1_fr',
                   lang='fr',
                   submitted=1)

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

        #get added NyStory
        for x in meta:
            if x.getLocalProperty('title', 'en') == 'story1':
                meta = x
            if x.getLocalProperty('title', 'fr') == 'story1_fr':
                meta_fr = x

        self.assertEqual(meta.getLocalProperty('title', 'en'), 'story1')
        self.assertEqual(meta_fr.getLocalProperty('title', 'fr'), 'story1_fr')

        #change NyStory title
        meta.saveProperties(title='story1_edited', lang='en')
        meta_fr.saveProperties(title='story1_fr_edited', lang='fr')

        self.assertEqual(meta.getLocalProperty('title', 'en'), 'story1_edited')
        self.assertEqual(meta_fr.getLocalProperty('title', 'fr'),
                         'story1_fr_edited')

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

        meta = self.portal.getCatalogedObjectsCheckView(
            meta_type=['Naaya Story'])
        self.assertEqual(meta, [])
Exemple #3
0
 def afterSetUp(self):
     from Products.Naaya.NyFolder import addNyFolder
     from Products.NaayaContent.NyStory.NyStory import addNyStory
     addNyFolder(self.portal, 'myfolder', contributor='contributor', submitted=1)
     addNyStory(self.portal.myfolder, id='mystory', title='My story', submitted=1, contributor='contributor')
     import transaction; transaction.commit()
Exemple #4
0
 def afterSetUp(self):
     from Products.NaayaContent.NyStory.NyStory import addNyStory
     addNyStory(self.portal.info, id='ver_story', title='ver_story', submitted=1)
     import transaction; transaction.commit()
Exemple #5
0
 def afterSetUp(self):
     portal = self.app.portal
     addNyFolder(portal, 'test_folder')
     addNyStory(portal.test_folder, id='test_story', title='test story')