Fix syntax errors

This commit is contained in:
Jon Pentland 2022-10-18 16:56:05 +02:00
parent d6bbff89c7
commit 45ef9a51c4

View File

@ -72,7 +72,7 @@ class ConversationTest(unittest.TestCase):
self.assertEqual(conversation.total_comments(), 1) self.assertEqual(conversation.total_comments(), 1)
self.assertTrue( self.assertTrue(
conversation.last_comment_date conversation.last_comment_date
- datetime.now().astimezone(timezone.utc)() - datetime.now().astimezone(timezone.utc)
< timedelta(seconds=1), < timedelta(seconds=1),
) )
@ -492,30 +492,30 @@ class ConversationTest(unittest.TestCase):
comment1 = createObject("plone.Comment") comment1 = createObject("plone.Comment")
comment1.text = "Comment text" comment1.text = "Comment text"
comment1.creation_date =\ comment1.creation_date =\
datetime.now().astimezone(timezone.utc)() - timedelta(4) datetime.now().astimezone(timezone.utc) - timedelta(4)
conversation.addComment(comment1) conversation.addComment(comment1)
comment2 = createObject("plone.Comment") comment2 = createObject("plone.Comment")
comment2.text = "Comment text" comment2.text = "Comment text"
comment2.creation_date =\ comment2.creation_date =\
datetime.now().astimezone(timezone.utc)() - timedelta(2) datetime.now().astimezone(timezone.utc) - timedelta(2)
new_comment2_id = conversation.addComment(comment2) new_comment2_id = conversation.addComment(comment2)
comment3 = createObject("plone.Comment") comment3 = createObject("plone.Comment")
comment3.text = "Comment text" comment3.text = "Comment text"
comment3.creation_date =\ comment3.creation_date =\
datetime.now().astimezone(timezone.utc)() - timedelta(1) datetime.now().astimezone(timezone.utc) - timedelta(1)
new_comment3_id = conversation.addComment(comment3) new_comment3_id = conversation.addComment(comment3)
# check if the latest comment is exactly one day old # check if the latest comment is exactly one day old
self.assertTrue( self.assertTrue(
conversation.last_comment_date conversation.last_comment_date
< datetime.now().astimezone(timezone.utc)() < datetime.now().astimezone(timezone.utc)
- timedelta(hours=23, minutes=59, seconds=59), - timedelta(hours=23, minutes=59, seconds=59),
) )
self.assertTrue( self.assertTrue(
conversation.last_comment_date conversation.last_comment_date
> datetime.now().astimezone(timezone.utc)() > datetime.now().astimezone(timezone.utc)
- timedelta(days=1, seconds=1), - timedelta(days=1, seconds=1),
) )
@ -526,12 +526,12 @@ class ConversationTest(unittest.TestCase):
# the latest comment should be exactly two days old # the latest comment should be exactly two days old
self.assertTrue( self.assertTrue(
conversation.last_comment_date conversation.last_comment_date
< datetime.now().astimezone(timezone.utc)() < datetime.now().astimezone(timezone.utc)
- timedelta(days=1, hours=23, minutes=59, seconds=59), - timedelta(days=1, hours=23, minutes=59, seconds=59),
) )
self.assertTrue( self.assertTrue(
conversation.last_comment_date conversation.last_comment_date
> datetime.now().astimezone(timezone.utc)() > datetime.now().astimezone(timezone.utc)
- timedelta(days=2, seconds=1), - timedelta(days=2, seconds=1),
) )
@ -542,12 +542,12 @@ class ConversationTest(unittest.TestCase):
# the latest comment should be exactly four days old # the latest comment should be exactly four days old
self.assertTrue( self.assertTrue(
conversation.last_comment_date conversation.last_comment_date
< datetime.now().astimezone(timezone.utc)() < datetime.now().astimezone(timezone.utc)
- timedelta(days=3, hours=23, minutes=59, seconds=59), - timedelta(days=3, hours=23, minutes=59, seconds=59),
) )
self.assertTrue( self.assertTrue(
conversation.last_comment_date conversation.last_comment_date
> datetime.now().astimezone(timezone.utc)() > datetime.now().astimezone(timezone.utc)
- timedelta(days=4, seconds=2), - timedelta(days=4, seconds=2),
) )