Skip to content

Commit

Permalink
Error in the site root
Browse files Browse the repository at this point in the history
  • Loading branch information
rodfersou committed Apr 6, 2020
1 parent f2d5493 commit c6590d0
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions src/plone/restapi/tests/test_dxcontent_serializer.py
Expand Up @@ -313,6 +313,45 @@ def test_nextprev_has_nextprev(self):
data["next_item"]
)

def test_nextprev_root_has_nextprev(self):
api.content.create(
container=self.portal,
type="Document",
title="Item 1",
description="Previous item"
)
doc = api.content.create(
container=self.portal,
type="Document",
title="Item 2",
description="Current item"
)
api.content.create(
container=self.portal,
type="Document",
title="Item 3",
description="Next item"
)
data = self.serialize(doc)
self.assertEqual(
{
"@id": "http://nohost/plone/folder-with-items/item-1",
"@type": "Document",
"title": "Item 1",
"description": "Previous item"
},
data["previous_item"]
)
self.assertEqual(
{
"@id": "http://nohost/plone/folder-with-items/item-3",
"@type": "Document",
"title": "Item 3",
"description": "Next item"
},
data["next_item"]
)

def test_richtext_serializer_context(self):
"""This checks if the context is passed in correctly.
Expand Down

0 comments on commit c6590d0

Please sign in to comment.