-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add contatti to pdc summary serializer
- Loading branch information
Showing
3 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,10 @@ | |
from plone.app.testing import SITE_OWNER_NAME | ||
from plone.app.testing import SITE_OWNER_PASSWORD | ||
from plone.app.testing import TEST_USER_ID | ||
from plone.restapi.interfaces import ISerializeToJsonSummary | ||
from plone.restapi.testing import RelativeSession | ||
from transaction import commit | ||
from zope.component import getMultiAdapter | ||
|
||
import unittest | ||
|
||
|
@@ -205,3 +207,18 @@ def test_summary_serializer_does_not_return_has_children_info_in_POST_calls(self | |
|
||
self.assertEqual(len(resp["items"]), 1) | ||
self.assertNotIn("has_children", resp["items"][0]) | ||
|
||
def test_pdc_summary_returns_also_contatti_data(self): | ||
contatti = [{"descrizione": "xxx", "tipo": "email", "valore": "[email protected]"}] | ||
|
||
pdc = api.content.create( | ||
container=self.portal, | ||
type="PuntoDiContatto", | ||
title="pdc", | ||
contatti=contatti, | ||
) | ||
|
||
serializer = getMultiAdapter((pdc, self.request), ISerializeToJsonSummary)() | ||
|
||
self.assertIn("contatti", serializer) | ||
self.assertEqual(serializer["contatti"], contatti) |