From 603c903eb8995711014ab8cebd56305a5fc1d949 Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Tue, 13 Aug 2024 21:46:27 +0200 Subject: [PATCH] Robot tests: install our GS profile. I noticed that on Jenkins only 142 robot tests were run instead of 149. The console showed the reason: ``` Set up plone.app.contenttypes.testing.PloneAppContenttypes in 0.020 seconds. Set up plone.app.robotframework.testing.SimplePublicationLayer in 0.001 seconds. Set up plone.app.robotframework.remote.RemoteLibraryBundle:RobotRemote in 0.000 seconds. Set up plone.testing.zope.WSGIServer in 0.043 seconds. Set up plone.app.robotframework.testing.RemoteLibrary:Robot in 0.000 seconds. Set up plone.app.discussion.testing.PloneAppDiscussionRobot Traceback (most recent call last): File "/Users/maurits/shared-eggs/cp311/zope.testrunner-6.4-py3.11.egg/zope/testrunner/runner.py", line 474, in run_layer setup_layer(options, layer, setup_layers) File "/Users/maurits/shared-eggs/cp311/zope.testrunner-6.4-py3.11.egg/zope/testrunner/runner.py", line 839, in setup_layer setup_layer(options, base, setup_layers) File "/Users/maurits/shared-eggs/cp311/zope.testrunner-6.4-py3.11.egg/zope/testrunner/runner.py", line 844, in setup_layer layer.setUp() File "/Users/maurits/shared-eggs/cp311/plone.app.testing-7.1.0-py3.11.egg/plone/app/testing/helpers.py", line 378, in setUp self.setUpPloneSite(portal) File "/Users/maurits/community/plone-coredev/6.1/src/plone.app.discussion/plone/app/discussion/testing.py", line 111, in setUpPloneSite settings = registry.forInterface(IDiscussionSettings) File "/Users/maurits/shared-eggs/cp311/plone.registry-2.0.1-py3.11.egg/plone/registry/registry.py", line 71, in forInterface raise KeyError( KeyError: 'Interface `plone.app.discussion.interfaces.IDiscussionSettings` defines a field `globally_enabled`, for which there is no record.' ``` --- plone/app/discussion/testing.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plone/app/discussion/testing.py b/plone/app/discussion/testing.py index fe23d84f..48a74392 100644 --- a/plone/app/discussion/testing.py +++ b/plone/app/discussion/testing.py @@ -106,6 +106,7 @@ class PloneAppDiscussionRobot(PloneAppDiscussion): ) def setUpPloneSite(self, portal): + applyProfile(portal, "plone.app.discussion:default") registry = queryUtility(IRegistry) settings = registry.forInterface(IDiscussionSettings) settings.globally_enabled = True