From 050dd667e147126b3a4ce57d37827efbc66ef462 Mon Sep 17 00:00:00 2001 From: davisagli Date: Fri, 20 Oct 2023 08:35:06 -0700 Subject: [PATCH] [fc] Repository: plone.rest Branch: refs/heads/main Date: 2023-10-20T15:28:41+02:00 Author: Roel Bruggink (jaroel) Commit: https://github.com/plone/plone.rest/commit/1bd2477b94a5e25a2fe28f46e6aecef0c781341a Reset SKIP_PTA to whatever it was. Before it would leak into other tests, enabling the publication check when it shouldn't be active. Files changed: M src/plone/rest/tests/test_explicitacquisition.py Repository: plone.rest Branch: refs/heads/main Date: 2023-10-20T16:18:35+02:00 Author: Roel Bruggink (jaroel) Commit: https://github.com/plone/plone.rest/commit/d83b13b6f3393453a9c7001a8549914f54a83393 changelog Files changed: A news/168.bugfix Repository: plone.rest Branch: refs/heads/main Date: 2023-10-20T16:23:13+02:00 Author: Roel Bruggink (jaroel) Commit: https://github.com/plone/plone.rest/commit/65a53943d56710353ac0fac24e2bd715bb0d78c4 Rename 168.bugfix to 168.internal Files changed: A news/168.internal D news/168.bugfix Repository: plone.rest Branch: refs/heads/main Date: 2023-10-20T08:35:06-07:00 Author: David Glick (davisagli) Commit: https://github.com/plone/plone.rest/commit/772e5b6eded46fb5a0d6a6ceaae123f0b9ebdfd4 Merge pull request #168 from plone/explicitacquisition-fixup-2 Fixup tests: reset SKIP_PTA to whatever it was Files changed: A news/168.internal M src/plone/rest/tests/test_explicitacquisition.py --- last_commit.txt | 161 ++++++++++-------------------------------------- 1 file changed, 33 insertions(+), 128 deletions(-) diff --git a/last_commit.txt b/last_commit.txt index 64fc87a808..18b7ea6bb9 100644 --- a/last_commit.txt +++ b/last_commit.txt @@ -1,161 +1,66 @@ -Repository: plone.api +Repository: plone.rest -Branch: refs/heads/master -Date: 2023-10-13T16:52:15+05:30 -Author: akshat2jain (Akshat2Jain) -Commit: https://github.com/plone/plone.api/commit/0384ee20c9f777a81cec3c43ebad842c8e34d781 - -fixed the number - -Files changed: -M src/plone/api/tests/test_content.py - -b'diff --git a/src/plone/api/tests/test_content.py b/src/plone/api/tests/test_content.py\nindex b411306b..bff0436b 100644\n--- a/src/plone/api/tests/test_content.py\n+++ b/src/plone/api/tests/test_content.py\n@@ -1014,7 +1014,7 @@ def test_find_interface_dict(self):\n "operator": "and",\n },\n )\n- self.assertEqual(len(brains), 1)\n+ self.assertEqual(len(brains), 2)\n \n # plone.api query using interfaces\n brains = api.content.find(\n@@ -1042,7 +1042,7 @@ def test_find_interface_dict__include_not_query(self):\n },\n )\n \n- self.assertEqual(len(brains_all) - len(brains), 1)\n+ self.assertEqual(len(brains_all) - len(brains), 0)\n \n def test_find_interface_dict__all_options(self):\n """Check for all options in a object_provides query are correctly\n' - -Repository: plone.api - - -Branch: refs/heads/master -Date: 2023-10-13T16:57:31+05:30 -Author: akshat2jain (Akshat2Jain) -Commit: https://github.com/plone/plone.api/commit/6504c3f277e09917627179fbacb102809679f467 - -added log entry - -Files changed: -A news/518.bugfix - -b'diff --git a/news/518.bugfix b/news/518.bugfix\nnew file mode 100644\nindex 00000000..437ea89f\n--- /dev/null\n+++ b/news/518.bugfix\n@@ -0,0 +1 @@\n+Update test assertions for object_provides index due to Plone Site changes. @Akshat2Jain\n\\ No newline at end of file\n' - -Repository: plone.api - - -Branch: refs/heads/master -Date: 2023-10-14T19:07:20+05:30 -Author: akshat2jain (Akshat2Jain) -Commit: https://github.com/plone/plone.api/commit/bce071ac2ca32e0de10cd6e62260be3093e8c02e - -added requested changes - -Files changed: -M src/plone/api/tests/test_content.py - -b'diff --git a/src/plone/api/tests/test_content.py b/src/plone/api/tests/test_content.py\nindex bff0436b..7ca32a2a 100644\n--- a/src/plone/api/tests/test_content.py\n+++ b/src/plone/api/tests/test_content.py\n@@ -1014,6 +1014,7 @@ def test_find_interface_dict(self):\n "operator": "and",\n },\n )\n+ # Plone Site also implements the IContentish and INavigationRoot interfaces.\n self.assertEqual(len(brains), 2)\n \n # plone.api query using interfaces\n@@ -1023,7 +1024,7 @@ def test_find_interface_dict(self):\n "operator": "and",\n },\n )\n- self.assertEqual(len(brains), 1)\n+ self.assertEqual(len(brains), 2)\n \n def test_find_interface_dict__include_not_query(self):\n """Check if not query in object_provides is functional."""\n@@ -1041,8 +1042,8 @@ def test_find_interface_dict__include_not_query(self):\n "not": INavigationRoot.__identifier__,\n },\n )\n-\n- self.assertEqual(len(brains_all) - len(brains), 0)\n+ # Plone Site also implements the IContentish and INavigationRoot interfaces.\n+ self.assertEqual(len(brains_all) - len(brains), 2)\n \n def test_find_interface_dict__all_options(self):\n """Check for all options in a object_provides query are correctly\n' - -Repository: plone.api - - -Branch: refs/heads/master -Date: 2023-10-19T15:00:04+02:00 -Author: Roel Bruggink (jaroel) -Commit: https://github.com/plone/plone.api/commit/02057fa09b7dc5c3b4e5c7ecccb0a61c49af40b9 - -Revert checks to status quo - -Files changed: -M src/plone/api/tests/test_content.py - -b'diff --git a/src/plone/api/tests/test_content.py b/src/plone/api/tests/test_content.py\nindex 7ca32a2a..a873d19b 100644\n--- a/src/plone/api/tests/test_content.py\n+++ b/src/plone/api/tests/test_content.py\n@@ -1014,8 +1014,8 @@ def test_find_interface_dict(self):\n "operator": "and",\n },\n )\n- # Plone Site also implements the IContentish and INavigationRoot interfaces.\n- self.assertEqual(len(brains), 2)\n+\n+ self.assertEqual(len(brains), 1)\n \n # plone.api query using interfaces\n brains = api.content.find(\n@@ -1024,7 +1024,7 @@ def test_find_interface_dict(self):\n "operator": "and",\n },\n )\n- self.assertEqual(len(brains), 2)\n+ self.assertEqual(len(brains), 1)\n \n def test_find_interface_dict__include_not_query(self):\n """Check if not query in object_provides is functional."""\n@@ -1042,8 +1042,7 @@ def test_find_interface_dict__include_not_query(self):\n "not": INavigationRoot.__identifier__,\n },\n )\n- # Plone Site also implements the IContentish and INavigationRoot interfaces.\n- self.assertEqual(len(brains_all) - len(brains), 2)\n+ self.assertEqual(len(brains_all) - len(brains), 1)\n \n def test_find_interface_dict__all_options(self):\n """Check for all options in a object_provides query are correctly\n' - -Repository: plone.api - - -Branch: refs/heads/master -Date: 2023-10-19T15:06:38+02:00 -Author: Roel Bruggink (jaroel) -Commit: https://github.com/plone/plone.api/commit/eab1cc5feb32313e5e2395c70e6695ac30030ea0 - -Use IFolder as PloneSite gained IContentish. - -Files changed: -M src/plone/api/tests/test_content.py - -b'diff --git a/src/plone/api/tests/test_content.py b/src/plone/api/tests/test_content.py\nindex a873d19b..8ca26f67 100644\n--- a/src/plone/api/tests/test_content.py\n+++ b/src/plone/api/tests/test_content.py\n@@ -7,13 +7,13 @@\n from plone import api\n from plone.api.content import _parse_object_provides_query\n from plone.api.tests.base import INTEGRATION_TESTING\n+from plone.app.contenttypes.interfaces import IFolder\n from plone.app.layout.navigation.interfaces import INavigationRoot\n from plone.app.linkintegrity.exceptions import LinkIntegrityNotificationException\n from plone.app.textfield import RichTextValue\n from plone.indexer import indexer\n from plone.uuid.interfaces import IMutableUUID\n from plone.uuid.interfaces import IUUIDGenerator\n-from Products.CMFCore.interfaces import IContentish\n from Products.CMFCore.WorkflowCore import WorkflowException\n from Products.ZCatalog.interfaces import IZCatalog\n from unittest import mock\n@@ -332,7 +332,7 @@ def test_create_raises_unicodedecodeerror(self):\n \n # register a title indexer that will force a UnicodeDecodeError\n # during content reindexing\n- @indexer(IContentish, IZCatalog)\n+ @indexer(IFolder, IZCatalog)\n def force_unicode_error(object):\n raise UnicodeDecodeError(\n "ascii",\n@@ -989,11 +989,11 @@ def test_find_depth(self):\n \n def test_find_interface(self):\n # Find documents by interface or it\'s identifier\n- identifier = IContentish.__identifier__\n+ identifier = IFolder.__identifier__\n brains = api.content.find(object_provides=identifier)\n by_identifier = [x.getObject() for x in brains]\n \n- brains = api.content.find(object_provides=IContentish)\n+ brains = api.content.find(object_provides=IFolder)\n by_interface = [x.getObject() for x in brains]\n \n self.assertEqual(by_identifier, by_interface)\n@@ -1008,7 +1008,7 @@ def test_find_interface_dict(self):\n brains = api.content.find(\n object_provides={\n "query": [\n- IContentish.__identifier__,\n+ IFolder.__identifier__,\n INavigationRoot.__identifier__,\n ],\n "operator": "and",\n@@ -1020,7 +1020,7 @@ def test_find_interface_dict(self):\n # plone.api query using interfaces\n brains = api.content.find(\n object_provides={\n- "query": [IContentish, INavigationRoot],\n+ "query": [IFolder, INavigationRoot],\n "operator": "and",\n },\n )\n@@ -1030,7 +1030,7 @@ def test_find_interface_dict__include_not_query(self):\n """Check if not query in object_provides is functional."""\n \n brains_all = api.content.find(\n- object_provides={"query": IContentish.__identifier__},\n+ object_provides={"query": IFolder.__identifier__},\n )\n \n alsoProvides(self.portal.events, INavigationRoot)\n@@ -1038,7 +1038,7 @@ def test_find_interface_dict__include_not_query(self):\n \n brains = api.content.find(\n object_provides={\n- "query": IContentish.__identifier__,\n+ "query": IFolder.__identifier__,\n "not": INavigationRoot.__identifier__,\n },\n )\n@@ -1051,42 +1051,42 @@ def test_find_interface_dict__all_options(self):\n parser = _parse_object_provides_query\n \n self.assertDictEqual(\n- parser({"query": IContentish}),\n- {"query": [IContentish.__identifier__], "operator": "or"},\n+ parser({"query": IFolder}),\n+ {"query": [IFolder.__identifier__], "operator": "or"},\n )\n \n self.assertDictEqual(\n parser(\n {\n- "query": [IContentish, INavigationRoot.__identifier__],\n+ "query": [IFolder, INavigationRoot.__identifier__],\n "operator": "and",\n },\n ),\n {\n- "query": [IContentish.__identifier__, INavigationRoot.__identifier__],\n+ "query": [IFolder.__identifier__, INavigationRoot.__identifier__],\n "operator": "and",\n },\n )\n \n self.assertDictEqual(\n- parser({"not": IContentish}),\n- {"not": [IContentish.__identifier__]},\n+ parser({"not": IFolder}),\n+ {"not": [IFolder.__identifier__]},\n )\n \n self.assertDictEqual(\n- parser({"not": [IContentish, INavigationRoot.__identifier__]}),\n- {"not": [IContentish.__identifier__, INavigationRoot.__identifier__]},\n+ parser({"not": [IFolder, INavigationRoot.__identifier__]}),\n+ {"not": [IFolder.__identifier__, INavigationRoot.__identifier__]},\n )\n \n self.assertDictEqual(\n- parser({"not": IContentish}),\n- {"not": [IContentish.__identifier__]},\n+ parser({"not": IFolder}),\n+ {"not": [IFolder.__identifier__]},\n )\n \n self.assertDictEqual(\n- parser({"query": IContentish, "operator": "and", "not": INavigationRoot}),\n+ parser({"query": IFolder, "operator": "and", "not": INavigationRoot}),\n {\n- "query": [IContentish.__identifier__],\n+ "query": [IFolder.__identifier__],\n "operator": "and",\n "not": [INavigationRoot.__identifier__],\n },\n@@ -1133,38 +1133,38 @@ def test_find_parse_object_provides_query(self):\n \n # single interface\n self.assertDictEqual(\n- parse(IContentish),\n+ parse(IFolder),\n {\n- "query": [IContentish.__identifier__],\n+ "query": [IFolder.__identifier__],\n "operator": "or",\n },\n )\n # single identifier\n self.assertDictEqual(\n- parse(IContentish.__identifier__),\n+ parse(IFolder.__identifier__),\n {\n- "query": [IContentish.__identifier__],\n+ "query": [IFolder.__identifier__],\n "operator": "or",\n },\n )\n # multiple interfaces/identifiers (mixed as list)\n self.assertDictEqual(\n- parse([INavigationRoot, IContentish.__identifier__]),\n+ parse([INavigationRoot, IFolder.__identifier__]),\n {\n "query": [\n INavigationRoot.__identifier__,\n- IContentish.__identifier__,\n+ IFolder.__identifier__,\n ],\n "operator": "or",\n },\n )\n # multiple interfaces/identifiers (mixed as tuple)\n self.assertDictEqual(\n- parse((INavigationRoot, IContentish.__identifier__)),\n+ parse((INavigationRoot, IFolder.__identifier__)),\n {\n "query": [\n INavigationRoot.__identifier__,\n- IContentish.__identifier__,\n+ IFolder.__identifier__,\n ],\n "operator": "or",\n },\n@@ -1173,14 +1173,14 @@ def test_find_parse_object_provides_query(self):\n self.assertDictEqual(\n parse(\n {\n- "query": [INavigationRoot, IContentish.__identifier__],\n+ "query": [INavigationRoot, IFolder.__identifier__],\n "operator": "and",\n }\n ),\n {\n "query": [\n INavigationRoot.__identifier__,\n- IContentish.__identifier__,\n+ IFolder.__identifier__,\n ],\n "operator": "and",\n },\n' - -Repository: plone.api - - -Branch: refs/heads/master -Date: 2023-10-19T15:09:11+02:00 +Branch: refs/heads/main +Date: 2023-10-20T15:28:41+02:00 Author: Roel Bruggink (jaroel) -Commit: https://github.com/plone/plone.api/commit/5717ffd8d3d470c96d04514b1f8b3c8da9de57a8 - -Spelling +Commit: https://github.com/plone/plone.rest/commit/1bd2477b94a5e25a2fe28f46e6aecef0c781341a -Files changed: -M src/plone/api/tests/test_content.py - -b'diff --git a/src/plone/api/tests/test_content.py b/src/plone/api/tests/test_content.py\nindex 8ca26f67..7123667c 100644\n--- a/src/plone/api/tests/test_content.py\n+++ b/src/plone/api/tests/test_content.py\n@@ -1,5 +1,4 @@\n """Tests for plone.api.content."""\n-\n from Acquisition import aq_base\n from OFS.CopySupport import CopyError\n from OFS.event import ObjectWillBeMovedEvent\n@@ -209,8 +208,8 @@ def test_create_dexterity(self):\n """Test create dexterity."""\n container = self.portal\n \n- # This section check for DX compatibilty. The custom DX types defined\n- # in plone.api are for Plone 4 compatiblity.\n+ # This section check for DX compatibility. The custom DX types defined\n+ # in plone.api are for Plone 4 compatibility.\n \n # Create a folder\n folder = api.content.create(\n@@ -446,7 +445,7 @@ def test_get_constraints(self):\n api.content.get()\n \n def test_get(self):\n- """Test the getting of content in varios ways."""\n+ """Test the getting of content in various ways."""\n # Test getting the about folder by path and UID\n about_by_path = api.content.get("/about")\n about_by_uid = api.content.get(UID=self.about.UID())\n@@ -707,7 +706,7 @@ def test_copy(self):\n container["about"]["our-team"] and container["about"]["our-team"] == ourteam\n )\n \n- # When copying whithout target parameter should take source parent\n+ # When copying without target parameter should take source parent\n api.content.copy(source=self.team, id="our-team-no-target")\n assert container["about"]["our-team-no-target"]\n \n@@ -1283,7 +1282,7 @@ def test_transition(self):\n "internally_published",\n )\n \n- def test_diable_roles_acquisition(self):\n+ def test_disable_roles_acquisition(self):\n """Test disabling local roles acquisition."""\n # This should fail because an content item is mandatory\n from plone.api.exc import MissingParameterError\n' - -Repository: plone.api - - -Branch: refs/heads/master -Date: 2023-10-19T17:15:52+02:00 -Author: Roel Bruggink (jaroel) -Commit: https://github.com/plone/plone.api/commit/84513e7b7d007c17cde6db284a061830b1fa52d8 +Reset SKIP_PTA to whatever it was. -fixup changelog +Before it would leak into other tests, enabling the publication check when it shouldn't be active. Files changed: -M news/518.bugfix +M src/plone/rest/tests/test_explicitacquisition.py -b'diff --git a/news/518.bugfix b/news/518.bugfix\nindex 437ea89f..bcefc6dd 100644\n--- a/news/518.bugfix\n+++ b/news/518.bugfix\n@@ -1 +1 @@\n-Update test assertions for object_provides index due to Plone Site changes. @Akshat2Jain\n\\ No newline at end of file\n+Fixup tests because PloneSite gets IContentish again. @Akshat2Jain @jaroel\n\\ No newline at end of file\n' +b'diff --git a/src/plone/rest/tests/test_explicitacquisition.py b/src/plone/rest/tests/test_explicitacquisition.py\nindex beee007..7c5d8cc 100644\n--- a/src/plone/rest/tests/test_explicitacquisition.py\n+++ b/src/plone/rest/tests/test_explicitacquisition.py\n@@ -68,10 +68,18 @@ class TestExplicitAcquisitionAvailable(unittest.TestCase):\n layer = PLONE_REST_INTEGRATION_TESTING\n \n def setUp(self):\n+ import Products.CMFCore.explicitacquisition\n+\n self.portal = self.layer["portal"]\n self.request = self.layer["request"]\n setRoles(self.portal, TEST_USER_ID, ["Manager"])\n self.portal.invokeFactory("Document", id="foo")\n+ self.PREVIOUS_SKIP_PTA = Products.CMFCore.explicitacquisition.SKIP_PTA\n+\n+ def tearDown(self):\n+ import Products.CMFCore.explicitacquisition\n+\n+ Products.CMFCore.explicitacquisition.SKIP_PTA = self.PREVIOUS_SKIP_PTA\n \n def traverse(self, path="/plone", accept="application/json", method="GET"):\n request = self.layer["request"]\n' -Repository: plone.api +Repository: plone.rest -Branch: refs/heads/master -Date: 2023-10-19T17:17:48+02:00 +Branch: refs/heads/main +Date: 2023-10-20T16:18:35+02:00 Author: Roel Bruggink (jaroel) -Commit: https://github.com/plone/plone.api/commit/4cd34b882da016c233826578675efbd63e9356d6 +Commit: https://github.com/plone/plone.rest/commit/d83b13b6f3393453a9c7001a8549914f54a83393 -towncrier entry is internal +changelog Files changed: -A news/518.internal -D news/518.bugfix +A news/168.bugfix -b'diff --git a/news/518.bugfix b/news/518.internal\nsimilarity index 100%\nrename from news/518.bugfix\nrename to news/518.internal\n' +b"diff --git a/news/168.bugfix b/news/168.bugfix\nnew file mode 100644\nindex 0000000..5b362b6\n--- /dev/null\n+++ b/news/168.bugfix\n@@ -0,0 +1 @@\n+Fix test leakage, enabling the publication check when it shouldn't be active. @jaroel\n\\ No newline at end of file\n" -Repository: plone.api +Repository: plone.rest -Branch: refs/heads/master -Date: 2023-10-19T17:54:22+02:00 +Branch: refs/heads/main +Date: 2023-10-20T16:23:13+02:00 Author: Roel Bruggink (jaroel) -Commit: https://github.com/plone/plone.api/commit/1a14c599dc029b84cd4d6ff7873c7de12266c001 +Commit: https://github.com/plone/plone.rest/commit/65a53943d56710353ac0fac24e2bd715bb0d78c4 -Merge remote-tracking branch 'origin/master' into fix_number +Rename 168.bugfix to 168.internal Files changed: -A news/1.bugfix -A news/1.internal -M .github/workflows/black.yml -M .github/workflows/docs.yml -M .github/workflows/isort.yml -M .github/workflows/plone_python.yml -M src/plone/api/tests/test_env.py -M tox.ini +A news/168.internal +D news/168.bugfix -b'diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml\nindex 420028cc..fc5371c7 100644\n--- a/.github/workflows/black.yml\n+++ b/.github/workflows/black.yml\n@@ -10,11 +10,11 @@ jobs:\n \n steps:\n # git checkout\n- - uses: actions/checkout@v2\n+ - uses: actions/checkout@v4\n \n # python setup\n - name: Set up Python ${{ matrix.python-version }}\n- uses: actions/setup-python@v1\n+ uses: actions/setup-python@v4\n with:\n python-version: ${{ matrix.python-version }}\n - name: Install dependencies\n@@ -23,7 +23,7 @@ jobs:\n pip install tox tox-gh-actions\n \n # python cache\n- - uses: actions/cache@v1\n+ - uses: actions/cache@v3\n with:\n path: ~/.cache/pip\n key: ${{ runner.os }}-pip-${{ hashFiles(\'**/requirements.txt\') }}\ndiff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml\nindex 93fc39fc..1cad5df7 100644\n--- a/.github/workflows/docs.yml\n+++ b/.github/workflows/docs.yml\n@@ -10,11 +10,11 @@ jobs:\n \n steps:\n # git checkout\n- - uses: actions/checkout@v2\n+ - uses: actions/checkout@v4\n \n # python setup\n - name: Set up Python ${{ matrix.python-version }}\n- uses: actions/setup-python@v1\n+ uses: actions/setup-python@v4\n with:\n python-version: ${{ matrix.python-version }}\n - name: Install dependencies\n@@ -23,7 +23,7 @@ jobs:\n pip install tox tox-gh-actions\n \n # python cache\n- - uses: actions/cache@v1\n+ - uses: actions/cache@v3\n with:\n path: ~/.cache/pip\n key: ${{ runner.os }}-pip-${{ hashFiles(\'**/requirements.txt\') }}\ndiff --git a/.github/workflows/isort.yml b/.github/workflows/isort.yml\nindex c6f499fc..3176e03f 100644\n--- a/.github/workflows/isort.yml\n+++ b/.github/workflows/isort.yml\n@@ -10,11 +10,11 @@ jobs:\n \n steps:\n # git checkout\n- - uses: actions/checkout@v2\n+ - uses: actions/checkout@v4\n \n # python setup\n - name: Set up Python ${{ matrix.python-version }}\n- uses: actions/setup-python@v1\n+ uses: actions/setup-python@v4\n with:\n python-version: ${{ matrix.python-version }}\n - name: Install dependencies\n@@ -23,7 +23,7 @@ jobs:\n pip install tox tox-gh-actions\n \n # python cache\n- - uses: actions/cache@v1\n+ - uses: actions/cache@v3\n with:\n path: ~/.cache/pip\n key: ${{ runner.os }}-pip-${{ hashFiles(\'**/requirements.txt\') }}\ndiff --git a/.github/workflows/plone_python.yml b/.github/workflows/plone_python.yml\nindex 86771fec..9b1948b9 100644\n--- a/.github/workflows/plone_python.yml\n+++ b/.github/workflows/plone_python.yml\n@@ -16,15 +16,15 @@ jobs:\n strategy:\n fail-fast: false\n matrix:\n- python-version: ["3.7", "3.8", "3.9"]\n- plone-version: ["5.2", "6.0"]\n+ python-version: ["3.8", "3.9", "3.10", "3.11"]\n+ plone-version: ["6.0"]\n \n steps:\n- - uses: actions/checkout@v3\n+ - uses: actions/checkout@v4\n - name: Install system libraries\n run: sudo apt-get install libxml2-dev libxslt1-dev libjpeg-dev\n - name: Set up Python ${{ matrix.python-version }}\n- uses: actions/setup-python@v2\n+ uses: actions/setup-python@v4\n with:\n python-version: ${{ matrix.python-version }}\n - name: Install dependencies\ndiff --git a/news/1.bugfix b/news/1.bugfix\nnew file mode 100644\nindex 00000000..1494e057\n--- /dev/null\n+++ b/news/1.bugfix\n@@ -0,0 +1,2 @@\n+Replace deprecated assert methods.\n+[gforcada]\ndiff --git a/news/1.internal b/news/1.internal\nnew file mode 100644\nindex 00000000..4af1df1b\n--- /dev/null\n+++ b/news/1.internal\n@@ -0,0 +1,2 @@\n+Update GHA\n+[gforcada]\ndiff --git a/src/plone/api/tests/test_env.py b/src/plone/api/tests/test_env.py\nindex f18037ce..3086a4d4 100644\n--- a/src/plone/api/tests/test_env.py\n+++ b/src/plone/api/tests/test_env.py\n@@ -514,14 +514,14 @@ def test_plone_version(self):\n from plone.api.env import plone_version\n \n self.assertTrue(isinstance(plone_version(), str))\n- self.assertRegexpMatches(plone_version(), version_regexp)\n+ self.assertRegex(plone_version(), version_regexp)\n \n def test_zope_version(self):\n """Tests that zope_version() returns Zope version."""\n from plone.api.env import zope_version\n \n self.assertTrue(isinstance(zope_version(), str))\n- self.assertRegexpMatches(zope_version(), version_regexp)\n+ self.assertRegex(zope_version(), version_regexp)\n \n def test_adopt_user_different_username(self):\n user = api.user.get(userid=TEST_USER_ID)\ndiff --git a/tox.ini b/tox.ini\nindex 7f4d12ee..4ec548d9 100644\n--- a/tox.ini\n+++ b/tox.ini\n@@ -1,7 +1,6 @@\n [tox]\n envlist =\n- py{37,38,39}-plone{52}\n- py{38,39}-plone{60}\n+ py{38,39,310,311}-plone{60}\n # towncrier\n # black-enforce\n black-check\n@@ -17,13 +16,13 @@ skip_missing_interpreters = True\n \n [gh-actions]\n python =\n- 3.7: py37\n 3.8: py38\n 3.9: py39\n+ 3.10: py310\n+ 3.11: py311\n \n [gh-actions:env]\n PLONE =\n- 52: plone52\n 60: plone60\n \n \n@@ -40,7 +39,6 @@ commands =\n \n setenv =\n BUILDOUT_FILE=test_plone-60.cfg\n- plone52: BUILDOUT_FILE=test_plone-52.cfg\n \n deps =\n pdbpp\n' +b"diff --git a/news/168.bugfix b/news/168.internal\nsimilarity index 74%\nrename from news/168.bugfix\nrename to news/168.internal\nindex 5b362b6..b4bdf12 100644\n--- a/news/168.bugfix\n+++ b/news/168.internal\n@@ -1 +1 @@\n-Fix test leakage, enabling the publication check when it shouldn't be active. @jaroel\n\\ No newline at end of file\n+Fix test leakage, enabling the publication check when it shouldn't be active. @jaroel\n" -Repository: plone.api +Repository: plone.rest -Branch: refs/heads/master -Date: 2023-10-19T14:06:10-03:00 -Author: Wesley Barroso Lopes (wesleybl) -Commit: https://github.com/plone/plone.api/commit/d93c6479b4ac7bf878c033bde2145336dd663fce +Branch: refs/heads/main +Date: 2023-10-20T08:35:06-07:00 +Author: David Glick (davisagli) +Commit: https://github.com/plone/plone.rest/commit/772e5b6eded46fb5a0d6a6ceaae123f0b9ebdfd4 -Merge pull request #518 from plone/fix_number +Merge pull request #168 from plone/explicitacquisition-fixup-2 -Fix failing tests related to object_provides index +Fixup tests: reset SKIP_PTA to whatever it was Files changed: -A news/518.internal -M src/plone/api/tests/test_content.py +A news/168.internal +M src/plone/rest/tests/test_explicitacquisition.py -b'diff --git a/news/518.internal b/news/518.internal\nnew file mode 100644\nindex 00000000..bcefc6dd\n--- /dev/null\n+++ b/news/518.internal\n@@ -0,0 +1 @@\n+Fixup tests because PloneSite gets IContentish again. @Akshat2Jain @jaroel\n\\ No newline at end of file\ndiff --git a/src/plone/api/tests/test_content.py b/src/plone/api/tests/test_content.py\nindex b411306b..7123667c 100644\n--- a/src/plone/api/tests/test_content.py\n+++ b/src/plone/api/tests/test_content.py\n@@ -1,5 +1,4 @@\n """Tests for plone.api.content."""\n-\n from Acquisition import aq_base\n from OFS.CopySupport import CopyError\n from OFS.event import ObjectWillBeMovedEvent\n@@ -7,13 +6,13 @@\n from plone import api\n from plone.api.content import _parse_object_provides_query\n from plone.api.tests.base import INTEGRATION_TESTING\n+from plone.app.contenttypes.interfaces import IFolder\n from plone.app.layout.navigation.interfaces import INavigationRoot\n from plone.app.linkintegrity.exceptions import LinkIntegrityNotificationException\n from plone.app.textfield import RichTextValue\n from plone.indexer import indexer\n from plone.uuid.interfaces import IMutableUUID\n from plone.uuid.interfaces import IUUIDGenerator\n-from Products.CMFCore.interfaces import IContentish\n from Products.CMFCore.WorkflowCore import WorkflowException\n from Products.ZCatalog.interfaces import IZCatalog\n from unittest import mock\n@@ -209,8 +208,8 @@ def test_create_dexterity(self):\n """Test create dexterity."""\n container = self.portal\n \n- # This section check for DX compatibilty. The custom DX types defined\n- # in plone.api are for Plone 4 compatiblity.\n+ # This section check for DX compatibility. The custom DX types defined\n+ # in plone.api are for Plone 4 compatibility.\n \n # Create a folder\n folder = api.content.create(\n@@ -332,7 +331,7 @@ def test_create_raises_unicodedecodeerror(self):\n \n # register a title indexer that will force a UnicodeDecodeError\n # during content reindexing\n- @indexer(IContentish, IZCatalog)\n+ @indexer(IFolder, IZCatalog)\n def force_unicode_error(object):\n raise UnicodeDecodeError(\n "ascii",\n@@ -446,7 +445,7 @@ def test_get_constraints(self):\n api.content.get()\n \n def test_get(self):\n- """Test the getting of content in varios ways."""\n+ """Test the getting of content in various ways."""\n # Test getting the about folder by path and UID\n about_by_path = api.content.get("/about")\n about_by_uid = api.content.get(UID=self.about.UID())\n@@ -707,7 +706,7 @@ def test_copy(self):\n container["about"]["our-team"] and container["about"]["our-team"] == ourteam\n )\n \n- # When copying whithout target parameter should take source parent\n+ # When copying without target parameter should take source parent\n api.content.copy(source=self.team, id="our-team-no-target")\n assert container["about"]["our-team-no-target"]\n \n@@ -989,11 +988,11 @@ def test_find_depth(self):\n \n def test_find_interface(self):\n # Find documents by interface or it\'s identifier\n- identifier = IContentish.__identifier__\n+ identifier = IFolder.__identifier__\n brains = api.content.find(object_provides=identifier)\n by_identifier = [x.getObject() for x in brains]\n \n- brains = api.content.find(object_provides=IContentish)\n+ brains = api.content.find(object_provides=IFolder)\n by_interface = [x.getObject() for x in brains]\n \n self.assertEqual(by_identifier, by_interface)\n@@ -1008,18 +1007,19 @@ def test_find_interface_dict(self):\n brains = api.content.find(\n object_provides={\n "query": [\n- IContentish.__identifier__,\n+ IFolder.__identifier__,\n INavigationRoot.__identifier__,\n ],\n "operator": "and",\n },\n )\n+\n self.assertEqual(len(brains), 1)\n \n # plone.api query using interfaces\n brains = api.content.find(\n object_provides={\n- "query": [IContentish, INavigationRoot],\n+ "query": [IFolder, INavigationRoot],\n "operator": "and",\n },\n )\n@@ -1029,7 +1029,7 @@ def test_find_interface_dict__include_not_query(self):\n """Check if not query in object_provides is functional."""\n \n brains_all = api.content.find(\n- object_provides={"query": IContentish.__identifier__},\n+ object_provides={"query": IFolder.__identifier__},\n )\n \n alsoProvides(self.portal.events, INavigationRoot)\n@@ -1037,11 +1037,10 @@ def test_find_interface_dict__include_not_query(self):\n \n brains = api.content.find(\n object_provides={\n- "query": IContentish.__identifier__,\n+ "query": IFolder.__identifier__,\n "not": INavigationRoot.__identifier__,\n },\n )\n-\n self.assertEqual(len(brains_all) - len(brains), 1)\n \n def test_find_interface_dict__all_options(self):\n@@ -1051,42 +1050,42 @@ def test_find_interface_dict__all_options(self):\n parser = _parse_object_provides_query\n \n self.assertDictEqual(\n- parser({"query": IContentish}),\n- {"query": [IContentish.__identifier__], "operator": "or"},\n+ parser({"query": IFolder}),\n+ {"query": [IFolder.__identifier__], "operator": "or"},\n )\n \n self.assertDictEqual(\n parser(\n {\n- "query": [IContentish, INavigationRoot.__identifier__],\n+ "query": [IFolder, INavigationRoot.__identifier__],\n "operator": "and",\n },\n ),\n {\n- "query": [IContentish.__identifier__, INavigationRoot.__identifier__],\n+ "query": [IFolder.__identifier__, INavigationRoot.__identifier__],\n "operator": "and",\n },\n )\n \n self.assertDictEqual(\n- parser({"not": IContentish}),\n- {"not": [IContentish.__identifier__]},\n+ parser({"not": IFolder}),\n+ {"not": [IFolder.__identifier__]},\n )\n \n self.assertDictEqual(\n- parser({"not": [IContentish, INavigationRoot.__identifier__]}),\n- {"not": [IContentish.__identifier__, INavigationRoot.__identifier__]},\n+ parser({"not": [IFolder, INavigationRoot.__identifier__]}),\n+ {"not": [IFolder.__identifier__, INavigationRoot.__identifier__]},\n )\n \n self.assertDictEqual(\n- parser({"not": IContentish}),\n- {"not": [IContentish.__identifier__]},\n+ parser({"not": IFolder}),\n+ {"not": [IFolder.__identifier__]},\n )\n \n self.assertDictEqual(\n- parser({"query": IContentish, "operator": "and", "not": INavigationRoot}),\n+ parser({"query": IFolder, "operator": "and", "not": INavigationRoot}),\n {\n- "query": [IContentish.__identifier__],\n+ "query": [IFolder.__identifier__],\n "operator": "and",\n "not": [INavigationRoot.__identifier__],\n },\n@@ -1133,38 +1132,38 @@ def test_find_parse_object_provides_query(self):\n \n # single interface\n self.assertDictEqual(\n- parse(IContentish),\n+ parse(IFolder),\n {\n- "query": [IContentish.__identifier__],\n+ "query": [IFolder.__identifier__],\n "operator": "or",\n },\n )\n # single identifier\n self.assertDictEqual(\n- parse(IContentish.__identifier__),\n+ parse(IFolder.__identifier__),\n {\n- "query": [IContentish.__identifier__],\n+ "query": [IFolder.__identifier__],\n "operator": "or",\n },\n )\n # multiple interfaces/identifiers (mixed as list)\n self.assertDictEqual(\n- parse([INavigationRoot, IContentish.__identifier__]),\n+ parse([INavigationRoot, IFolder.__identifier__]),\n {\n "query": [\n INavigationRoot.__identifier__,\n- IContentish.__identifier__,\n+ IFolder.__identifier__,\n ],\n "operator": "or",\n },\n )\n # multiple interfaces/identifiers (mixed as tuple)\n self.assertDictEqual(\n- parse((INavigationRoot, IContentish.__identifier__)),\n+ parse((INavigationRoot, IFolder.__identifier__)),\n {\n "query": [\n INavigationRoot.__identifier__,\n- IContentish.__identifier__,\n+ IFolder.__identifier__,\n ],\n "operator": "or",\n },\n@@ -1173,14 +1172,14 @@ def test_find_parse_object_provides_query(self):\n self.assertDictEqual(\n parse(\n {\n- "query": [INavigationRoot, IContentish.__identifier__],\n+ "query": [INavigationRoot, IFolder.__identifier__],\n "operator": "and",\n }\n ),\n {\n "query": [\n INavigationRoot.__identifier__,\n- IContentish.__identifier__,\n+ IFolder.__identifier__,\n ],\n "operator": "and",\n },\n@@ -1283,7 +1282,7 @@ def test_transition(self):\n "internally_published",\n )\n \n- def test_diable_roles_acquisition(self):\n+ def test_disable_roles_acquisition(self):\n """Test disabling local roles acquisition."""\n # This should fail because an content item is mandatory\n from plone.api.exc import MissingParameterError\n' +b'diff --git a/news/168.internal b/news/168.internal\nnew file mode 100644\nindex 0000000..b4bdf12\n--- /dev/null\n+++ b/news/168.internal\n@@ -0,0 +1 @@\n+Fix test leakage, enabling the publication check when it shouldn\'t be active. @jaroel\ndiff --git a/src/plone/rest/tests/test_explicitacquisition.py b/src/plone/rest/tests/test_explicitacquisition.py\nindex beee007..7c5d8cc 100644\n--- a/src/plone/rest/tests/test_explicitacquisition.py\n+++ b/src/plone/rest/tests/test_explicitacquisition.py\n@@ -68,10 +68,18 @@ class TestExplicitAcquisitionAvailable(unittest.TestCase):\n layer = PLONE_REST_INTEGRATION_TESTING\n \n def setUp(self):\n+ import Products.CMFCore.explicitacquisition\n+\n self.portal = self.layer["portal"]\n self.request = self.layer["request"]\n setRoles(self.portal, TEST_USER_ID, ["Manager"])\n self.portal.invokeFactory("Document", id="foo")\n+ self.PREVIOUS_SKIP_PTA = Products.CMFCore.explicitacquisition.SKIP_PTA\n+\n+ def tearDown(self):\n+ import Products.CMFCore.explicitacquisition\n+\n+ Products.CMFCore.explicitacquisition.SKIP_PTA = self.PREVIOUS_SKIP_PTA\n \n def traverse(self, path="/plone", accept="application/json", method="GET"):\n request = self.layer["request"]\n'