Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly globally disable comments in the tests that need it. #1805

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions news/244.tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Explicitly globally disable comments in the tests that need it.
[maurits]
6 changes: 6 additions & 0 deletions src/plone/restapi/tests/test_dxcontent_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,9 @@ def test_allow_discussion_by_default(self):
self.assertEqual(False, obj["allow_discussion"])

def test_allow_discussion_obj_instance_allows_but_not_global_enabled(self):
registry = queryUtility(IRegistry)
settings = registry.forInterface(IDiscussionSettings, check=False)
settings.globally_enabled = False
self.portal.invokeFactory("Document", id="doc2")
self.portal.doc2.allow_discussion = True
serializer = getMultiAdapter((self.portal.doc2, self.request), ISerializeToJson)
Expand All @@ -536,6 +539,9 @@ def test_allow_discussion_obj_instance_allows_but_not_global_enabled(self):
self.assertEqual(False, obj["allow_discussion"])

def test_allow_discussion_fti_allows_not_global_enabled(self):
registry = queryUtility(IRegistry)
settings = registry.forInterface(IDiscussionSettings, check=False)
settings.globally_enabled = False
self.portal.invokeFactory("Document", id="doc2")
portal_types = getToolByName(self.portal, "portal_types")
document_fti = getattr(portal_types, self.portal.doc2.portal_type)
Expand Down
Loading