From 2df8ff4ea75567187a2c27769ce0f51b541ddddb Mon Sep 17 00:00:00 2001 From: Jon Pentland Date: Sat, 22 Oct 2022 12:13:20 +0100 Subject: [PATCH] Try reindexing comment and increasing delta (in case of slow test causing failure) --- plone/app/discussion/tests/test_conversation.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plone/app/discussion/tests/test_conversation.py b/plone/app/discussion/tests/test_conversation.py index 54a6395..b177c74 100644 --- a/plone/app/discussion/tests/test_conversation.py +++ b/plone/app/discussion/tests/test_conversation.py @@ -105,13 +105,15 @@ class ConversationTest(unittest.TestCase): # Remove the timezone from the comment dates comment.creation_date = datetime.utcnow() comment.modification_date = datetime.utcnow() + + comment.reindexObject() # Check that the timezone naive date is converted to UTC # See https://github.com/plone/plone.app.discussion/pull/204 self.assertTrue( conversation.last_comment_date - datetime.utcnow().replace(tzinfo=timezone.utc) - < timedelta(seconds=1), + < timedelta(seconds=10), ) self.assertTrue(comment.creation_date.tzinfo, timezone.utc) self.assertTrue(comment.modification_date.tzinfo, timezone.utc)