New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue 23 - Remove liveblog workflow #31
Conversation
modified = datetime.fromtimestamp(timestamp) | ||
timedelta = datetime.now() - modified | ||
# Last modification is less than 2 days ago | ||
return timedelta.days < 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you better compare against a timedelta object, something like:
from datetime import timedelta
return timedelta(days=1) < datetime.now() - modified
you forgot to update the documentation |
I didn't forget, the PR is not ready |
@@ -1,9 +1,9 @@ | |||
<?xml version="1.0"?> | |||
<object name="portal_workflow" meta_type="Plone Workflow Tool"> | |||
<object name="liveblog_workflow" meta_type="Workflow"/> | |||
<object name="liveblog_workflow" meta_type="Workflow" purge="True" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be done programmatically to avid having to register a new profile
b623cad
to
6bcc3cd
Compare
# simulate (partially) state on previous version | ||
wtool = api.portal.get_tool('portal_workflow') | ||
wtool.setChainForPortalTypes(('Liveblog',), ('liveblog_workflow',)) | ||
assert wtool.getChainForPortalType('Liveblog') == ('liveblog_workflow',) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not use self.assertEqual
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because that is not a test, but a precondition for a test; the result is the same, is just semantics.
closes #23