diff --git a/news/1776.documentation b/news/1776.documentation new file mode 100644 index 0000000000..a1e34cf4af --- /dev/null +++ b/news/1776.documentation @@ -0,0 +1 @@ +Fix event start & end timezone in documentation examples. @davisagli diff --git a/src/plone/restapi/tests/http-examples/event.resp b/src/plone/restapi/tests/http-examples/event.resp index a8538c9fc6..2591e61803 100644 --- a/src/plone/restapi/tests/http-examples/event.resp +++ b/src/plone/restapi/tests/http-examples/event.resp @@ -44,7 +44,7 @@ Content-Type: application/json ], "description": "This is an event", "effective": null, - "end": "2013-01-01T12:00:00", + "end": "2013-01-01T12:00:00+00:00", "event_url": null, "exclude_from_nav": false, "expires": null, @@ -78,7 +78,7 @@ Content-Type: application/json "relatedItems": [], "review_state": "private", "rights": "", - "start": "2013-01-01T10:00:00", + "start": "2013-01-01T10:00:00+00:00", "subjects": [], "sync_uid": null, "text": null, diff --git a/src/plone/restapi/tests/test_documentation.py b/src/plone/restapi/tests/test_documentation.py index e10c2e97cf..9c0fc9d342 100644 --- a/src/plone/restapi/tests/test_documentation.py +++ b/src/plone/restapi/tests/test_documentation.py @@ -1,5 +1,6 @@ from base64 import b64encode from datetime import datetime +from datetime import timezone from pkg_resources import resource_filename from plone import api from plone.app.discussion.interfaces import ICommentAddedEvent @@ -319,8 +320,8 @@ def test_documentation_event(self): self.portal.invokeFactory("Event", id="event") self.portal.event.title = "Event" self.portal.event.description = "This is an event" - self.portal.event.start = datetime(2013, 1, 1, 10, 0) - self.portal.event.end = datetime(2013, 1, 1, 12, 0) + self.portal.event.start = datetime(2013, 1, 1, 10, 0, tzinfo=timezone.utc) + self.portal.event.end = datetime(2013, 1, 1, 12, 0, tzinfo=timezone.utc) transaction.commit() response = self.api_session.get(self.portal.event.absolute_url()) save_request_and_response_for_docs("event", response)