Fix syntax errors
This commit is contained in:
parent
d6bbff89c7
commit
45ef9a51c4
@ -72,7 +72,7 @@ class ConversationTest(unittest.TestCase):
|
||||
self.assertEqual(conversation.total_comments(), 1)
|
||||
self.assertTrue(
|
||||
conversation.last_comment_date
|
||||
- datetime.now().astimezone(timezone.utc)()
|
||||
- datetime.now().astimezone(timezone.utc)
|
||||
< timedelta(seconds=1),
|
||||
)
|
||||
|
||||
@ -492,30 +492,30 @@ class ConversationTest(unittest.TestCase):
|
||||
comment1 = createObject("plone.Comment")
|
||||
comment1.text = "Comment text"
|
||||
comment1.creation_date =\
|
||||
datetime.now().astimezone(timezone.utc)() - timedelta(4)
|
||||
datetime.now().astimezone(timezone.utc) - timedelta(4)
|
||||
conversation.addComment(comment1)
|
||||
|
||||
comment2 = createObject("plone.Comment")
|
||||
comment2.text = "Comment text"
|
||||
comment2.creation_date =\
|
||||
datetime.now().astimezone(timezone.utc)() - timedelta(2)
|
||||
datetime.now().astimezone(timezone.utc) - timedelta(2)
|
||||
new_comment2_id = conversation.addComment(comment2)
|
||||
|
||||
comment3 = createObject("plone.Comment")
|
||||
comment3.text = "Comment text"
|
||||
comment3.creation_date =\
|
||||
datetime.now().astimezone(timezone.utc)() - timedelta(1)
|
||||
datetime.now().astimezone(timezone.utc) - timedelta(1)
|
||||
new_comment3_id = conversation.addComment(comment3)
|
||||
|
||||
# check if the latest comment is exactly one day old
|
||||
self.assertTrue(
|
||||
conversation.last_comment_date
|
||||
< datetime.now().astimezone(timezone.utc)()
|
||||
< datetime.now().astimezone(timezone.utc)
|
||||
- timedelta(hours=23, minutes=59, seconds=59),
|
||||
)
|
||||
self.assertTrue(
|
||||
conversation.last_comment_date
|
||||
> datetime.now().astimezone(timezone.utc)()
|
||||
> datetime.now().astimezone(timezone.utc)
|
||||
- timedelta(days=1, seconds=1),
|
||||
)
|
||||
|
||||
@ -526,12 +526,12 @@ class ConversationTest(unittest.TestCase):
|
||||
# the latest comment should be exactly two days old
|
||||
self.assertTrue(
|
||||
conversation.last_comment_date
|
||||
< datetime.now().astimezone(timezone.utc)()
|
||||
< datetime.now().astimezone(timezone.utc)
|
||||
- timedelta(days=1, hours=23, minutes=59, seconds=59),
|
||||
)
|
||||
self.assertTrue(
|
||||
conversation.last_comment_date
|
||||
> datetime.now().astimezone(timezone.utc)()
|
||||
> datetime.now().astimezone(timezone.utc)
|
||||
- timedelta(days=2, seconds=1),
|
||||
)
|
||||
|
||||
@ -542,12 +542,12 @@ class ConversationTest(unittest.TestCase):
|
||||
# the latest comment should be exactly four days old
|
||||
self.assertTrue(
|
||||
conversation.last_comment_date
|
||||
< datetime.now().astimezone(timezone.utc)()
|
||||
< datetime.now().astimezone(timezone.utc)
|
||||
- timedelta(days=3, hours=23, minutes=59, seconds=59),
|
||||
)
|
||||
self.assertTrue(
|
||||
conversation.last_comment_date
|
||||
> datetime.now().astimezone(timezone.utc)()
|
||||
> datetime.now().astimezone(timezone.utc)
|
||||
- timedelta(days=4, seconds=2),
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user