From 45ef9a51c48f023384815c1d5002925181578514 Mon Sep 17 00:00:00 2001 From: Jon Pentland Date: Tue, 18 Oct 2022 15:56:05 +0100 Subject: [PATCH] Fix syntax errors --- .../app/discussion/tests/test_conversation.py | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/plone/app/discussion/tests/test_conversation.py b/plone/app/discussion/tests/test_conversation.py index 69179c0..92b72ce 100644 --- a/plone/app/discussion/tests/test_conversation.py +++ b/plone/app/discussion/tests/test_conversation.py @@ -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), )