From 85de8c9428516f162b46ea21e0c23f0a45613f8f Mon Sep 17 00:00:00 2001 From: Roel Bruggink Date: Sun, 3 Mar 2019 13:52:54 +0100 Subject: [PATCH 1/4] Products.ResourceRegistries isnn't installed anymore --- src/plone/app/testing/layers.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plone/app/testing/layers.py b/src/plone/app/testing/layers.py index fcc8775..7ad98f4 100644 --- a/src/plone/app/testing/layers.py +++ b/src/plone/app/testing/layers.py @@ -57,7 +57,6 @@ class PloneFixture(Layer): ('Products.MimetypesRegistry', {'loadZCML': True}, ), ('Products.PortalTransforms', {'loadZCML': True}, ), ('Products.ExtendedPathIndex', {'loadZCML': True}, ), - ('Products.ResourceRegistries', {'loadZCML': True}, ), ('Products.SiteAccess', {'loadZCML': False}, ), ('Products.CMFEditions', {'loadZCML': True}, ), ('Products.CMFDiffTool', {'loadZCML': True}, ), From a51aacd4b49f94cc5d7ab41558fc60d4ea267513 Mon Sep 17 00:00:00 2001 From: Roel Bruggink Date: Sun, 3 Mar 2019 16:49:57 +0100 Subject: [PATCH 2/4] computer says nno --- src/plone/app/testing/layers.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plone/app/testing/layers.rst b/src/plone/app/testing/layers.rst index 49291e8..6445afd 100644 --- a/src/plone/app/testing/layers.rst +++ b/src/plone/app/testing/layers.rst @@ -338,7 +338,7 @@ We can now look for this new object through the server. ['http', '//localhost'] >>> from six.moves.urllib.request import urlopen - >>> conn = urlopen(portal_url + '/Title', timeout=10) + >>> conn = urlopen(portal_url, timeout=10) >>> responseBody = conn.read() >>> b"Fancy Portal" in responseBody True From 3d4e97ee0a845c948f43e0114ea7d32f940959b4 Mon Sep 17 00:00:00 2001 From: Roel Bruggink Date: Sat, 22 Aug 2020 21:51:36 +0200 Subject: [PATCH 3/4] MailHost is an item now --- src/plone/app/testing/layers.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plone/app/testing/layers.py b/src/plone/app/testing/layers.py index c04dbd9..330a597 100644 --- a/src/plone/app/testing/layers.py +++ b/src/plone/app/testing/layers.py @@ -397,7 +397,8 @@ def testSetUp(self): registry["plone.email_from_name"] = u"Plone site" portal._original_MailHost = portal.MailHost - portal.MailHost = mailhost = MockMailHost('MailHost') + del portal['MailHost'] + portal['MailHost'] = mailhost = MockMailHost('MailHost') sm = getSiteManager(context=portal) sm.unregisterUtility(provided=IMailHost) @@ -409,7 +410,8 @@ def testTearDown(self): portal = app[PLONE_SITE_ID] registry = getUtility(IRegistry, context=portal) - portal.MailHost = portal._original_MailHost + del portal['MailHost'] + portal['MailHost'] = portal._original_MailHost sm = getSiteManager(context=portal) sm.unregisterUtility(provided=IMailHost) From cb5ab351a9db7a0b525c3158d157915759eb320d Mon Sep 17 00:00:00 2001 From: ale-rt Date: Wed, 10 Feb 2021 15:21:48 +0100 Subject: [PATCH 4/4] No need to del and object before readding it --- src/plone/app/testing/layers.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/plone/app/testing/layers.py b/src/plone/app/testing/layers.py index 91c2d32..27b929e 100644 --- a/src/plone/app/testing/layers.py +++ b/src/plone/app/testing/layers.py @@ -386,8 +386,7 @@ def testSetUp(self): registry["plone.email_from_name"] = u"Plone site" portal._original_MailHost = portal.MailHost - del portal['MailHost'] - portal['MailHost'] = mailhost = MockMailHost('MailHost') + portal.MailHost = mailhost = MockMailHost('MailHost') sm = getSiteManager(context=portal) sm.unregisterUtility(provided=IMailHost) @@ -399,8 +398,7 @@ def testTearDown(self): portal = app[PLONE_SITE_ID] registry = getUtility(IRegistry, context=portal) - del portal['MailHost'] - portal['MailHost'] = portal._original_MailHost + portal.MailHost = portal._original_MailHost sm = getSiteManager(context=portal) sm.unregisterUtility(provided=IMailHost)