Skip to content

Commit

Permalink
Removed isExpired.py skin script. #1801 (#2570)
Browse files Browse the repository at this point in the history
  • Loading branch information
reinhardt authored and ale-rt committed Oct 15, 2018
1 parent 8358c7c commit 042eb21
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 33 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
15 changes: 0 additions & 15 deletions Products/CMFPlone/skins/plone_scripts/isExpired.py

This file was deleted.

23 changes: 5 additions & 18 deletions Products/CMFPlone/tests/testContentPublishing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -180,32 +181,18 @@ 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'])
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.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))

0 comments on commit 042eb21

Please sign in to comment.