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

Use the dexterity machinery in api.content.create #484

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Conversation

ale-rt
Copy link
Member

@ale-rt ale-rt commented May 18, 2022

Fixes #439

@mister-roboto
Copy link

@ale-rt thanks for creating this Pull Request and helping to improve Plone!

TL;DR: Finish pushing changes, pass all other checks, then paste a comment:

@jenkins-plone-org please run jobs

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically.

Happy hacking!

@ale-rt
Copy link
Member Author

ale-rt commented May 18, 2022

@jenkins-plone-org please run jobs

@ale-rt
Copy link
Member Author

ale-rt commented May 18, 2022

@jenkins-plone-org please run jobs

Copy link
Member

@mauritsvanrees mauritsvanrees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So far, it looks good to me, from looking at the code.
Nice one with the context manager in the tests. :-)

@ale-rt
Copy link
Member Author

ale-rt commented May 19, 2022

So far, it looks good to me, from looking at the code. Nice one with the context manager in the tests. :-)

Thanks for looking at it.
I still see some issues, e.g. this test passes in master but not in this branch:

+     def test_create_document_subject(self):
+         "When passing the subject as a string, it should be saved as a tuple"
+         obj = api.content.create(
+             container=self.portal,
+             type="Dexterity Item",
+             id="foo",
+             subject="bar"
+         )
+         self.assertEqual(obj.subject, ("bar",))

@davisagli davisagli changed the base branch from master to main December 16, 2024 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

In api.content.create, avoid renaming object if "id" was not given
3 participants