From 64783c323b326012dded38c45a836e8948ed9601 Mon Sep 17 00:00:00 2001 From: Mikel Larreategi Date: Thu, 21 Nov 2024 00:19:55 +0100 Subject: [PATCH] fix tests (#1844) * fix tests * changelog --- news/1844.bugfix | 2 ++ src/plone/restapi/tests/test_serializer_summary.py | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 news/1844.bugfix diff --git a/news/1844.bugfix b/news/1844.bugfix new file mode 100644 index 0000000000..2cee040a30 --- /dev/null +++ b/news/1844.bugfix @@ -0,0 +1,2 @@ +Fix tests after #1839 and plone.app.event#411 +[erral] diff --git a/src/plone/restapi/tests/test_serializer_summary.py b/src/plone/restapi/tests/test_serializer_summary.py index 7945792419..9a7b7db455 100644 --- a/src/plone/restapi/tests/test_serializer_summary.py +++ b/src/plone/restapi/tests/test_serializer_summary.py @@ -273,7 +273,10 @@ def test_dx_event_with_recurrence_new_version(self): tomorrow_str = tomorrow.strftime("%Y-%m-%d") ot = OccurrenceTraverser(self.event, self.request) ocurrence = ot.publishTraverse(self.request, tomorrow_str) + self.request.form["metadata_fields"] = ["start"] summary = getMultiAdapter((ocurrence, self.request), ISerializeToJsonSummary)() - - self.assertEqual(summary["start"], tomorrow_str) - self.assertEqual(summary["Title"], ocurrence.Title()) + self.assertEqual( + datetime.fromisoformat(summary["start"]).date().isoformat(), + tomorrow.date().isoformat(), + ) + self.assertEqual(summary["title"], ocurrence.Title())