-
-
Notifications
You must be signed in to change notification settings - Fork 6
Add an exception so that JSON POST requests inside portal_resources don't fail #61
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
base: main
Are you sure you want to change the base?
Changes from all commits
1e73909
317aee7
47d7a3f
526af88
17fefde
a8ab00d
4d41fd5
b77a374
a38c205
106e2cf
ac51526
410a2a6
0a5f22e
77716d8
3907aa6
9a025b3
ec9ec0e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -126,3 +126,7 @@ def test_json_request_to_view_namespace_returns_view(self): | |
| self.portal[self.portal.invokeFactory('Folder', id='folder1')] | ||
| obj = self.traverse('/plone/folder1/@@folder_contents') | ||
| self.assertTrue(IBrowserView.providedBy(obj), 'IBrowserView expected') | ||
|
|
||
| def test_json_request_to_portal_resource_returns_page_template(self): | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @displacedaussie returning a page template on a JSON request violates the HTTP specs (content negotiation). If portal_resource is actually doing this should be fixed in Zope/Plone, not in plone.rest.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't believe zope/plone is https://github.com/plone/plone.app.theming/blob/master/src/plone/app/theming/browser/themefile.py#L25. |
||
| obj = self.traverse('/plone/portal_resources') | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @displacedaussie this is not a POST request. Are you sure this test fails without the fix? |
||
| self.assertIsNotNone(obj, 'Object expected') | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@displacedaussie could you please elaborate why this is necessary here? I would like to keep the plone.rest test fixture as lightweight as possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise portal_resources doesn't exist. And that is what plone.rest is messing with the traversal of.