From 35b11a0120a267e875e5c0e733b823a10ad090c4 Mon Sep 17 00:00:00 2001 From: Jon Pentland Date: Sat, 22 Oct 2022 11:16:14 +0100 Subject: [PATCH] Prevent test failures when converting to timezone --- plone/app/discussion/tests/test_conversation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plone/app/discussion/tests/test_conversation.py b/plone/app/discussion/tests/test_conversation.py index a36f88b..54a6395 100644 --- a/plone/app/discussion/tests/test_conversation.py +++ b/plone/app/discussion/tests/test_conversation.py @@ -110,7 +110,7 @@ class ConversationTest(unittest.TestCase): # See https://github.com/plone/plone.app.discussion/pull/204 self.assertTrue( conversation.last_comment_date - - datetime.now().astimezone(timezone.utc) + - datetime.utcnow().replace(tzinfo=timezone.utc) < timedelta(seconds=1), ) self.assertTrue(comment.creation_date.tzinfo, timezone.utc)