[Testbot] Plone 5.0 - Python 2.7 - Build # 2945 - Still failing! - 0 failure(s)

jenkins at plone.org jenkins at plone.org
Sat Aug 9 18:09:36 UTC 2014


-------------------------------------------------------------------------------
Plone 5.0 - Python 2.7 - Build # 2945 - Still Failing!
-------------------------------------------------------------------------------

http://jenkins.plone.org/job/plone-5.0-python-2.7/2945/


-------------------------------------------------------------------------------
CHANGES
-------------------------------------------------------------------------------

Repository: plone.app.linkintegrity
Branch: refs/heads/master
Date: 2014-08-09T19:06:54+02:00
Author: Timo Stollenwerk (tisto) <tisto at plone.org>
Commit: https://github.com/plone/plone.app.linkintegrity/commit/e4656fae41e5d71e28e757c561df276d167ec0d0

Read the enable_link_integrity_checks setting from plone.app.registry.

Files changed:
M CHANGES.rst
M plone/app/linkintegrity/info.py
M plone/app/linkintegrity/tests/test_functional.py

diff --git a/CHANGES.rst b/CHANGES.rst
index 846763c..acee2da 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -4,6 +4,10 @@ Changelog
 2.1.0 (unreleased)
 ------------------
 
+- Read the enable_link_integrity_checks setting from plone.app.registry
+  instead of from the portal_properties.
+  [timo]
+
 - Restructure package to fully support dexterity framework. Use two different
   test layers in ``plone.app.testing``, migrate all doctests into real
   TestCases.
diff --git a/plone/app/linkintegrity/info.py b/plone/app/linkintegrity/info.py
index 610cfc1..f48423d 100644
--- a/plone/app/linkintegrity/info.py
+++ b/plone/app/linkintegrity/info.py
@@ -3,6 +3,8 @@
 from zope.component import queryUtility
 from Acquisition import aq_base
 from Products.CMFCore.interfaces import IPropertiesTool
+from zope.component import getUtility
+from plone.registry.interfaces import IRegistry
 
 try:
     from plone.uuid.interfaces import IUUID
@@ -14,6 +16,11 @@ def IUUID(obj, default=None):
             return obj.UID()
         else:
             return default
+try:
+    from Products.CMFPlone.interfaces import IEditingSchema
+    IS_PLONE5 = True
+except ImportError:
+    IS_PLONE5 = False
 
 
 class LinkIntegrityInfo(object):
@@ -28,12 +35,20 @@ def __init__(self, context):
 
     def integrityCheckingEnabled(self):
         """ determine if link integrity checking for the site is enabled """
+        # Plone 5 uses p.a.registry to store the enable_link_integrity setting.
+        if IS_PLONE5:
+            registry = getUtility(IRegistry)
+            settings = registry.forInterface(IEditingSchema, prefix='plone')
+            return settings.enable_link_integrity_checks
+        # Plone version < 5 store the enable_link_integrity setting in the
+        # site_properties.
         ptool = queryUtility(IPropertiesTool)
         enabled = False
         if ptool is not None:
             props = getattr(ptool, 'site_properties', None)
             if props is not None:
-                enabled = props.getProperty('enable_link_integrity_checks', False)
+                enabled = props.getProperty(
+                    'enable_link_integrity_checks', False)
         return enabled
 
     def getIntegrityInfo(self):
diff --git a/plone/app/linkintegrity/tests/test_functional.py b/plone/app/linkintegrity/tests/test_functional.py
index f604db7..caa5903 100644
--- a/plone/app/linkintegrity/tests/test_functional.py
+++ b/plone/app/linkintegrity/tests/test_functional.py
@@ -1,6 +1,8 @@
 # -*- coding: utf-8 -*-
 from ZPublisher.Publish import Retry
 from Products.Archetypes.interfaces import IReferenceable
+from Products.CMFPlone.interfaces import IEditingSchema
+
 from plone.app.linkintegrity import testing
 from plone.app.linkintegrity import exceptions
 from plone.app.linkintegrity.tests.base import ATBaseTestCase
@@ -8,6 +10,9 @@
 from plone.app.testing import TEST_USER_NAME
 from plone.app.testing import TEST_USER_PASSWORD
 from plone.testing.z2 import Browser
+from plone.registry.interfaces import IRegistry
+from zope.component import getUtility
+
 
 import transaction
 import unittest
@@ -259,8 +264,9 @@ def test_linkintegrity_on_of_switch(self):
 
         # Now we turn the switch for link integrity checking off via the site
         # properties and try again:
-        props = self.portal.portal_properties.site_properties
-        props.manage_changeProperties(enable_link_integrity_checks=False)
+        registry = getUtility(IRegistry)
+        settings = registry.forInterface(IEditingSchema, prefix='plone')
+        settings.enable_link_integrity_checks = False
         transaction.commit()
         self.browser.reload()
         self.assertEqual(self.browser.url, self.portal.absolute_url())




-------------------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CHANGES.log
Type: application/octet-stream
Size: 4189 bytes
Desc: not available
URL: <http://lists.plone.org/pipermail/plone-testbot/attachments/20140809/93a80d3c/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: build.log
Type: application/octet-stream
Size: 96599 bytes
Desc: not available
URL: <http://lists.plone.org/pipermail/plone-testbot/attachments/20140809/93a80d3c/attachment-0003.obj>


More information about the Testbot mailing list