Prevent test failures when converting to timezone

This commit is contained in:
Jon Pentland 2022-10-22 12:16:14 +02:00
parent 194f2d9f76
commit 35b11a0120

View File

@ -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)