diff --git a/CHANGES.rst b/CHANGES.rst index 95fda6dd1d..7e737f4198 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -21,6 +21,9 @@ Breaking changes: - Removed getObjectsFromPathList.py skin script. #1801 [reinhardt] +- Removed isExpired.py skin script. #1801 + [reinhardt] + - Removed redirectToReferrer.py skin script. #1801 [tlotze] diff --git a/Products/CMFPlone/skins/plone_scripts/isExpired.py b/Products/CMFPlone/skins/plone_scripts/isExpired.py deleted file mode 100644 index 9e68f7df36..0000000000 --- a/Products/CMFPlone/skins/plone_scripts/isExpired.py +++ /dev/null @@ -1,15 +0,0 @@ -## Script (Python) "isExpired" -##bind container=container -##bind context=context -##bind namespace= -##bind script=script -##bind subpath=traverse_subpath -##parameters=content=None -##title=Find out if the object is expired - -from Products.CMFPlone.utils import isExpired - -if not content: - content = context - -return isExpired(content) diff --git a/Products/CMFPlone/tests/testContentPublishing.py b/Products/CMFPlone/tests/testContentPublishing.py index 30838929a0..aedf3afe00 100644 --- a/Products/CMFPlone/tests/testContentPublishing.py +++ b/Products/CMFPlone/tests/testContentPublishing.py @@ -3,6 +3,7 @@ # code inspired by Ween from Products.CMFPlone.tests.PloneTestCase import PloneTestCase +from Products.CMFPlone.utils import isExpired text = """I lick my brain in silence Rather squeeze my head instead @@ -119,7 +120,7 @@ def testPublishingSubobjectsAndExpireThem(self): self.folder.f1.f2): self.assertEqual(self.workflow.getInfoFor(o, 'review_state'), 'published') - self.assertTrue(self.portal.isExpired(o)) + self.assertTrue(isExpired(o)) def testPublishingWithoutSubobjects(self): self.setRoles(['Manager']) # Make sure we can publish directly @@ -180,7 +181,7 @@ def testPublishingDefaultPageWhenFolderCannotBePublished(self): self.workflow.getInfoFor(self.folder.d1, 'review_state'), 'published') - # test setting effective/expiration date and isExpired script + # test setting effective/expiration date and isExpired method def testIsExpiredWithExplicitExpiredContent(self): self.setRoles(['Manager']) @@ -188,24 +189,10 @@ def testIsExpiredWithExplicitExpiredContent(self): self.folder.d1.content_status_modify(workflow_action='publish', effective_date='1/1/2001', expiration_date='1/2/2001') - self.assertTrue(self.portal.isExpired(self.folder.d1)) - - def testIsExpiredWithImplicitExpiredContent(self): - self.setRoles(['Manager']) - self.folder.invokeFactory('Document', id='d1', title='Doc 1') - self.folder.d1.content_status_modify(workflow_action='publish', - effective_date='1/1/2001', - expiration_date='1/2/2001') - self.assertTrue(self.folder.d1.isExpired()) + self.assertTrue(isExpired(self.folder.d1)) def testIsExpiredWithExplicitNonExpiredContent(self): self.setRoles(['Manager']) self.folder.invokeFactory('Document', id='d1', title='Doc 1') self.folder.d1.content_status_modify(workflow_action='publish') - self.assertFalse(self.portal.isExpired(self.folder.d1)) - - def testIsExpiredWithImplicitNonExpiredContent(self): - self.setRoles(['Manager']) - self.folder.invokeFactory('Document', id='d1', title='Doc 1') - self.folder.d1.content_status_modify(workflow_action='publish') - self.assertFalse(self.folder.d1.isExpired()) + self.assertFalse(isExpired(self.folder.d1))