Skip to content

Commit 9aba62d

Browse files
Fix deprecation warnings.
Use `plone.base.utils` instead of `Products.CMFPlone.utils` when deprecated. No longer pass deprecated `setup_content=False` to `addPloneSite` call. Sample warning for the last one: ``` Set up plone.app.testing.layers.PloneFixture .../Products/CMFPlone/factory.py:176: DeprecationWarning: addPloneSite ignores the setup_content keyword argument since Plone 6.1, treating it as always False. In Plone 7 it will be removed. ```
1 parent fbf5436 commit 9aba62d

5 files changed

Lines changed: 5 additions & 6 deletions

File tree

docs/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,7 @@ has been applied. Some of the more common such tests are shown below.
11641164
To verify that a product has been installed (e.g. as a dependency via
11651165
``metadata.xml``)::
11661166

1167-
from Products.CMFPlone.utils import get_installer
1167+
from plone.base.utils import get_installer
11681168

11691169
qi = get_installer(portal)
11701170
self.assertTrue(qi.is_product_installed('my.product'))

src/plone/app/testing/bbb.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
from AccessControl import getSecurityManager
44
from plone.app import testing
5+
from plone.base.utils import unrestricted_construct_instance
56
from plone.testing import zope
6-
from Products.CMFPlone.utils import _createObjectByType
77
from Testing.ZopeTestCase.functional import Functional
88

99
import transaction
@@ -14,7 +14,7 @@ def _createMemberarea(portal, user_id):
1414
mtool = portal.portal_membership
1515
members = mtool.getMembersFolder()
1616
if members is None:
17-
_createObjectByType("Folder", portal, id="Members")
17+
unrestricted_construct_instance("Folder", portal, id="Members")
1818
if not mtool.getMemberareaCreationFlag():
1919
mtool.setMemberareaCreationFlag()
2020
mtool.createMemberArea(user_id)

src/plone/app/testing/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def quickInstallProduct(portal, productName, reinstall=False):
7979

8080
zope.login(app["acl_users"], SITE_OWNER_NAME)
8181

82-
from Products.CMFPlone.utils import get_installer
82+
from plone.base.utils import get_installer
8383

8484
qi = get_installer(portal)
8585

src/plone/app/testing/helpers.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ course, if our setup had changed any other global or external state, we would
5050
need to tear that down as well.
5151

5252
>>> def is_installed(portal, product_name):
53-
... from Products.CMFPlone.utils import get_installer
53+
... from plone.base.utils import get_installer
5454
... qi = get_installer(portal)
5555
... return qi.is_product_installed(product_name)
5656

src/plone/app/testing/layers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@ def setUpDefaultContent(self, app):
210210
app,
211211
PLONE_SITE_ID,
212212
title=PLONE_SITE_TITLE,
213-
setup_content=False,
214213
default_language=DEFAULT_LANGUAGE,
215214
extension_ids=self.extensionProfiles,
216215
)

0 commit comments

Comments
 (0)