def test_default_page_updated_on_rename_objects(self):
     from plone.app.content.browser.contents.rename import RenameActionView
     self.portal.setDefaultPage('page')
     uid = IUUID(self.portal.page)
     self.request.form.update({
         'UID_0': uid,
         'newid_0': 'page-renamed',
         'newtitle_0': 'Page'
     })
     view = RenameActionView(self.portal, self.request)
     view()
     self.assertEqual(self.portal.getDefaultPage(), 'page-renamed')
 def test_folder_rename_objects(self):
     from plone.app.content.browser.contents.rename import RenameActionView
     uid = IUUID(self.portal.page)
     self.portal.invokeFactory('Document', id='page2', title='2nd page')
     uid2 = IUUID(self.portal.page2)
     self.request.form.update({
         'UID_0': uid,
         'newid_0': 'I am UnSafe! ',
         'newtitle_0': 'New!',
         'UID_1': uid2,
         'newid_1': '. ,;new id : _! ',
         'newtitle_1': 'Newer!'
     })
     view = RenameActionView(self.portal, self.request)
     view()
     self.assertEqual(self.portal['i-am-unsafe'].title, "New!")
     self.assertEqual(self.portal['new-id-_'].title, "Newer!")