From cb3b2cce82af8947b7af79a678b6290a1ba7f138 Mon Sep 17 00:00:00 2001 From: davisagli Date: Wed, 11 Dec 2024 16:06:59 -0800 Subject: [PATCH] [fc] Repository: plone.restapi Branch: refs/heads/main Date: 2024-12-11T16:06:59-08:00 Author: David Glick (davisagli) Commit: https://github.com/plone/plone.restapi/commit/d012d3f784c5897d5b70164daabdb99b3903ebca fix time-dependence of event recurrent tests (#1850) * fix time-dependence of event recurrent tests * changelog Files changed: A news/1850.internal M src/plone/restapi/tests/test_serializer_summary.py --- last_commit.txt | 34 +++++++++++----------------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/last_commit.txt b/last_commit.txt index 0c912f59ee..daa021304e 100644 --- a/last_commit.txt +++ b/last_commit.txt @@ -1,32 +1,20 @@ -Repository: Products.CMFEditions +Repository: plone.restapi -Branch: refs/heads/master -Date: 2024-12-11T14:08:16-08:00 +Branch: refs/heads/main +Date: 2024-12-11T16:06:59-08:00 Author: David Glick (davisagli) -Commit: https://github.com/plone/Products.CMFEditions/commit/da3a03ceaafcbc5d7c7a10acaa1c7d104f1eb7ef +Commit: https://github.com/plone/plone.restapi/commit/d012d3f784c5897d5b70164daabdb99b3903ebca -Preparing release 4.0.4 +fix time-dependence of event recurrent tests (#1850) -Files changed: -M CHANGES.rst -M setup.py -D news/26.bugfix - -b'diff --git a/CHANGES.rst b/CHANGES.rst\nindex 20d6e4f2..66f734e5 100644\n--- a/CHANGES.rst\n+++ b/CHANGES.rst\n@@ -8,6 +8,16 @@ Changelog\n \n .. towncrier release notes start\n \n+4.0.4 (2024-12-11)\n+------------------\n+\n+Bug fixes:\n+\n+\n+- Fix "Can\'t pickle objects in acquisition wrappers." error in\n+ `OMOutsideChildrensModifier` and `OMInsideChildrensModifier`. @davisagli (#26)\n+\n+\n 4.0.3 (2024-01-18)\n ------------------\n \ndiff --git a/news/26.bugfix b/news/26.bugfix\ndeleted file mode 100644\nindex 0a58eb0d..00000000\n--- a/news/26.bugfix\n+++ /dev/null\n@@ -1,2 +0,0 @@\n-Fix "Can\'t pickle objects in acquisition wrappers." error in\n-`OMOutsideChildrensModifier` and `OMInsideChildrensModifier`. @davisagli\ndiff --git a/setup.py b/setup.py\nindex 3ffbd319..42ad53e6 100644\n--- a/setup.py\n+++ b/setup.py\n@@ -3,7 +3,7 @@\n from setuptools import setup\n \n \n-version = "4.0.4.dev0"\n+version = "4.0.4"\n \n long_description = (\n f"{Path(\'README.rst\').read_text()}\\n{Path(\'CHANGES.rst\').read_text()}"\n' - -Repository: Products.CMFEditions - - -Branch: refs/heads/master -Date: 2024-12-11T14:09:30-08:00 -Author: David Glick (davisagli) -Commit: https://github.com/plone/Products.CMFEditions/commit/a56c1d89019faaf75023bf008bac5d6de1e36eb9 - -back to dev +* fix time-dependence of event recurrent tests + +* changelog Files changed: -M setup.py +A news/1850.internal +M src/plone/restapi/tests/test_serializer_summary.py -b'diff --git a/setup.py b/setup.py\nindex 42ad53e..e000140 100644\n--- a/setup.py\n+++ b/setup.py\n@@ -3,7 +3,7 @@\n from setuptools import setup\n \n \n-version = "4.0.4"\n+version = "4.0.5.dev0"\n \n long_description = (\n f"{Path(\'README.rst\').read_text()}\\n{Path(\'CHANGES.rst\').read_text()}"\n' +b'diff --git a/news/1850.internal b/news/1850.internal\nnew file mode 100644\nindex 000000000..d4a67450a\n--- /dev/null\n+++ b/news/1850.internal\n@@ -0,0 +1 @@\n+Fix time-dependence of tests. @davisagli\ndiff --git a/src/plone/restapi/tests/test_serializer_summary.py b/src/plone/restapi/tests/test_serializer_summary.py\nindex 9a7b7db45..e186c2f31 100644\n--- a/src/plone/restapi/tests/test_serializer_summary.py\n+++ b/src/plone/restapi/tests/test_serializer_summary.py\n@@ -17,6 +17,7 @@\n from zope.interface import alsoProvides\n \n import Missing\n+import pytz\n import unittest\n \n \n@@ -234,14 +235,15 @@ def setUp(self):\n )\n self.portal.portal_types.DXTestDocument.behaviors = behaviors\n \n+ self.start = datetime(1995, 7, 31, 13, 45, tzinfo=pytz.timezone("UTC"))\n self.event = createContentInContainer(\n self.portal,\n "DXTestDocument",\n id="doc1",\n title="Lorem Ipsum event",\n description="Description event",\n- start=datetime.now(),\n- end=datetime.now() + timedelta(hours=1),\n+ start=self.start,\n+ end=self.start + timedelta(hours=1),\n recurrence="RRULE:FREQ=DAILY;COUNT=3", # see https://github.com/plone/plone.app.event/blob/master/plone/app/event/tests/base_setup.py\n )\n \n@@ -256,7 +258,7 @@ def tearDown(self):\n "this test needs a plone.app.event version that does not include a IContentListingObject adapter",\n )\n def test_dx_event_with_recurrence_old_version(self):\n- tomorrow = datetime.now() + timedelta(days=1)\n+ tomorrow = self.start + timedelta(days=1)\n tomorrow_str = tomorrow.strftime("%Y-%m-%d")\n ot = OccurrenceTraverser(self.event, self.request)\n ocurrence = ot.publishTraverse(self.request, tomorrow_str)\n@@ -269,7 +271,7 @@ def test_dx_event_with_recurrence_old_version(self):\n "this test needs a plone.app.event version that includes a IContentListingObject adapter",\n )\n def test_dx_event_with_recurrence_new_version(self):\n- tomorrow = datetime.now() + timedelta(days=1)\n+ tomorrow = self.start + timedelta(days=1)\n tomorrow_str = tomorrow.strftime("%Y-%m-%d")\n ot = OccurrenceTraverser(self.event, self.request)\n ocurrence = ot.publishTraverse(self.request, tomorrow_str)\n'