Skip to content

Commit

Permalink
Fix event dates in docs (#1776)
Browse files Browse the repository at this point in the history
* Fix event dates in docs

* changelog
  • Loading branch information
davisagli authored Apr 30, 2024
1 parent 3cf4a1b commit f2e3653
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions news/1776.documentation
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix event start & end timezone in documentation examples. @davisagli
4 changes: 2 additions & 2 deletions src/plone/restapi/tests/http-examples/event.resp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
5 changes: 3 additions & 2 deletions src/plone/restapi/tests/test_documentation.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit f2e3653

Please sign in to comment.