[Testbot] Plone 4.3 - Python 2.6 - Build # 2025 - Fixed! - 0 failure(s)

jenkins at plone.org jenkins at plone.org
Tue Apr 22 15:34:40 UTC 2014


-------------------------------------------------------------------------------
Plone 4.3 - Python 2.6 - Build # 2025 - Fixed!
-------------------------------------------------------------------------------

http://jenkins.plone.org/job/plone-4.3-python-2.6/2025/


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

Repository: plone.portlet.static
Branch: refs/heads/master
Date: 2014-04-22T16:51:08+02:00
Author: Simon Delcourt (sdelcourt) <delcourt.simon at gmail.com>
Commit: https://github.com/plone/plone.portlet.static/commit/8e0bf53dd406c7428ea214082fd4ed636f77fb8e

migrate tests on plone.app.testing

Files changed:
A plone/portlet/static/testing.py
D plone/portlet/static/tests/base.py

diff --git a/plone/portlet/static/testing.py b/plone/portlet/static/testing.py
new file mode 100644
index 0000000..345d4d8
--- /dev/null
+++ b/plone/portlet/static/testing.py
@@ -0,0 +1,52 @@
+# -*- coding: utf-8 -*-
+
+from zope.configuration import xmlconfig
+
+from plone.testing import z2
+
+from plone.app.testing import TEST_USER_ID
+from plone.app.testing import TEST_USER_NAME
+from plone.app.testing import setRoles
+from plone.app.testing import login
+from plone.app.testing import PloneSandboxLayer
+from plone.app.testing import applyProfile
+from plone.app.testing.layers import IntegrationTesting
+
+
+class PlonePortletStaticLayer(PloneSandboxLayer):
+
+    def setUpZope(self, app, configurationContext):
+        import Products.ATContentTypes
+        self.loadZCML(package=Products.ATContentTypes)
+        z2.installProduct(app, 'Products.Archetypes')
+        z2.installProduct(app, 'Products.ATContentTypes')
+        z2.installProduct(app, 'plone.portlet.static')
+        import plone.portlet.static
+        xmlconfig.file(
+            'configure.zcml',
+            plone.portlet.static,
+            context=configurationContext)
+
+    def setUpPloneSite(self, portal):
+        applyProfile(portal, 'Products.ATContentTypes:default')
+        applyProfile(portal, 'plone.portlet.static:default')
+        setRoles(portal, TEST_USER_ID, ['Manager'])
+        login(portal, TEST_USER_NAME)
+        portal.acl_users.userFolderAddUser('admin',
+                                           'secret',
+                                           ['Manager'],
+                                           [])
+        portal.invokeFactory(
+            "Folder",
+            id="test-folder",
+            title=u"Test Folder"
+        )
+
+    def tearDownZope(self, app):
+        z2.uninstallProduct(app, 'plone.portlet.static')
+
+PLONEPORTLETSTATIC_FIXTURE = PlonePortletStaticLayer()
+
+PLONEPORTLETSTATIC_INTEGRATION_TESTING = IntegrationTesting(
+    bases=(PLONEPORTLETSTATIC_FIXTURE,),
+    name="PloneAppCollectionLayer:Integration")
diff --git a/plone/portlet/static/tests/base.py b/plone/portlet/static/tests/base.py
deleted file mode 100644
index 6270dca..0000000
--- a/plone/portlet/static/tests/base.py
+++ /dev/null
@@ -1,29 +0,0 @@
-from Testing import ZopeTestCase as ztc
-from Products.Five import zcml
-from Products.Five import fiveconfigure
-from Products.PloneTestCase import PloneTestCase as ptc
-from Products.PloneTestCase.layer import onsetup
-
-
- at onsetup
-def setup_package():
-    fiveconfigure.debug_mode = True
-    import plone.portlet.static
-    zcml.load_config('configure.zcml', plone.portlet.static)
-    fiveconfigure.debug_mode = False
-    ztc.installPackage('plone.portlet.static')
-
-setup_package()
-ptc.setupPloneSite(extension_profiles=(
-    'plone.portlet.static:default',
-))
-
-
-class TestCase(ptc.PloneTestCase):
-    """Base class used for test cases
-    """
-
-
-class FunctionalTestCase(ptc.FunctionalTestCase):
-    """Test case class used for functional (doc-)tests
-    """


Repository: plone.portlet.static
Branch: refs/heads/master
Date: 2014-04-22T16:52:53+02:00
Author: Simon Delcourt (sdelcourt) <delcourt.simon at gmail.com>
Commit: https://github.com/plone/plone.portlet.static/commit/6b4b61ab4d3f40d5baf6eff1e5490ee9b9f1c5bc

adapt tests to plone.app.testing

Files changed:
M plone/portlet/static/tests/test_portlet_static.py

diff --git a/plone/portlet/static/tests/test_portlet_static.py b/plone/portlet/static/tests/test_portlet_static.py
index 4f7486c..c1babd7 100644
--- a/plone/portlet/static/tests/test_portlet_static.py
+++ b/plone/portlet/static/tests/test_portlet_static.py
@@ -1,3 +1,9 @@
+
+from plone.app.testing import login
+from plone.app.testing import setRoles
+from plone.app.testing import TEST_USER_ID
+from plone.app.testing import TEST_USER_NAME
+
 from plone.portlets.interfaces import IPortletType
 from plone.portlets.interfaces import IPortletManager
 from plone.portlets.interfaces import IPortletAssignment
@@ -7,13 +13,20 @@
 from zope.component import getUtility, getMultiAdapter
 
 from plone.portlet.static import static
-from plone.portlet.static.tests.base import TestCase
+from plone.portlet.static.testing import PLONEPORTLETSTATIC_INTEGRATION_TESTING
+
+import unittest2 as unittest
 
 
-class TestPortlet(TestCase):
+class TestPortlet(unittest.TestCase):
 
-    def afterSetUp(self):
-        self.setRoles(('Manager', ))
+    layer = PLONEPORTLETSTATIC_INTEGRATION_TESTING
+
+    def setUp(self):
+        self.portal = self.layer['portal']
+        self.folder = getattr(self.portal, 'test-folder')
+        setRoles(self.portal, TEST_USER_ID, ['Manager'])
+        login(self.portal, TEST_USER_NAME)
 
     def testPortletTypeRegistered(self):
         portlet = getUtility(IPortletType, name='plone.portlet.static.Static')
@@ -31,7 +44,7 @@ def testInvokeAddview(self):
             del mapping[m]
         addview = mapping.restrictedTraverse('+/' + portlet.addview)
 
-        addview.createAndAdd(data={'header' : u"test title", 'text' : u"test text"})
+        addview.createAndAdd(data={'header': u"test title", 'text': u"test text"})
 
         self.assertEquals(len(mapping), 1)
         self.failUnless(isinstance(mapping.values()[0], static.Assignment))
@@ -58,10 +71,15 @@ def testRenderer(self):
                         "Renderer should be available by default.")
 
 
-class TestRenderer(TestCase):
+class TestRenderer(unittest.TestCase):
+
+    layer = PLONEPORTLETSTATIC_INTEGRATION_TESTING
 
-    def afterSetUp(self):
-        self.setRoles(('Manager', ))
+    def setUp(self):
+        self.portal = self.layer['portal']
+        self.folder = getattr(self.portal, 'test-folder')
+        setRoles(self.portal, TEST_USER_ID, ['Manager'])
+        login(self.portal, TEST_USER_NAME)
 
     def renderer(self, context=None, request=None, view=None, manager=None, assignment=None):
         context = context or self.folder


Repository: plone.portlet.static
Branch: refs/heads/master
Date: 2014-04-22T17:00:43+02:00
Author: Timo Stollenwerk (tisto) <tisto at plone.org>
Commit: https://github.com/plone/plone.portlet.static/commit/7915cf7b560731583d20ebb982e770ca3ce31ecd

Merge pull request #4 from plone/migrate_tests_to_ploneapptesting

Migrate tests to ploneapptesting

Files changed:
A plone/portlet/static/testing.py
M plone/portlet/static/tests/test_portlet_static.py
D plone/portlet/static/tests/base.py

diff --git a/plone/portlet/static/testing.py b/plone/portlet/static/testing.py
new file mode 100644
index 0000000..345d4d8
--- /dev/null
+++ b/plone/portlet/static/testing.py
@@ -0,0 +1,52 @@
+# -*- coding: utf-8 -*-
+
+from zope.configuration import xmlconfig
+
+from plone.testing import z2
+
+from plone.app.testing import TEST_USER_ID
+from plone.app.testing import TEST_USER_NAME
+from plone.app.testing import setRoles
+from plone.app.testing import login
+from plone.app.testing import PloneSandboxLayer
+from plone.app.testing import applyProfile
+from plone.app.testing.layers import IntegrationTesting
+
+
+class PlonePortletStaticLayer(PloneSandboxLayer):
+
+    def setUpZope(self, app, configurationContext):
+        import Products.ATContentTypes
+        self.loadZCML(package=Products.ATContentTypes)
+        z2.installProduct(app, 'Products.Archetypes')
+        z2.installProduct(app, 'Products.ATContentTypes')
+        z2.installProduct(app, 'plone.portlet.static')
+        import plone.portlet.static
+        xmlconfig.file(
+            'configure.zcml',
+            plone.portlet.static,
+            context=configurationContext)
+
+    def setUpPloneSite(self, portal):
+        applyProfile(portal, 'Products.ATContentTypes:default')
+        applyProfile(portal, 'plone.portlet.static:default')
+        setRoles(portal, TEST_USER_ID, ['Manager'])
+        login(portal, TEST_USER_NAME)
+        portal.acl_users.userFolderAddUser('admin',
+                                           'secret',
+                                           ['Manager'],
+                                           [])
+        portal.invokeFactory(
+            "Folder",
+            id="test-folder",
+            title=u"Test Folder"
+        )
+
+    def tearDownZope(self, app):
+        z2.uninstallProduct(app, 'plone.portlet.static')
+
+PLONEPORTLETSTATIC_FIXTURE = PlonePortletStaticLayer()
+
+PLONEPORTLETSTATIC_INTEGRATION_TESTING = IntegrationTesting(
+    bases=(PLONEPORTLETSTATIC_FIXTURE,),
+    name="PloneAppCollectionLayer:Integration")
diff --git a/plone/portlet/static/tests/base.py b/plone/portlet/static/tests/base.py
deleted file mode 100644
index 6270dca..0000000
--- a/plone/portlet/static/tests/base.py
+++ /dev/null
@@ -1,29 +0,0 @@
-from Testing import ZopeTestCase as ztc
-from Products.Five import zcml
-from Products.Five import fiveconfigure
-from Products.PloneTestCase import PloneTestCase as ptc
-from Products.PloneTestCase.layer import onsetup
-
-
- at onsetup
-def setup_package():
-    fiveconfigure.debug_mode = True
-    import plone.portlet.static
-    zcml.load_config('configure.zcml', plone.portlet.static)
-    fiveconfigure.debug_mode = False
-    ztc.installPackage('plone.portlet.static')
-
-setup_package()
-ptc.setupPloneSite(extension_profiles=(
-    'plone.portlet.static:default',
-))
-
-
-class TestCase(ptc.PloneTestCase):
-    """Base class used for test cases
-    """
-
-
-class FunctionalTestCase(ptc.FunctionalTestCase):
-    """Test case class used for functional (doc-)tests
-    """
diff --git a/plone/portlet/static/tests/test_portlet_static.py b/plone/portlet/static/tests/test_portlet_static.py
index 4f7486c..c1babd7 100644
--- a/plone/portlet/static/tests/test_portlet_static.py
+++ b/plone/portlet/static/tests/test_portlet_static.py
@@ -1,3 +1,9 @@
+
+from plone.app.testing import login
+from plone.app.testing import setRoles
+from plone.app.testing import TEST_USER_ID
+from plone.app.testing import TEST_USER_NAME
+
 from plone.portlets.interfaces import IPortletType
 from plone.portlets.interfaces import IPortletManager
 from plone.portlets.interfaces import IPortletAssignment
@@ -7,13 +13,20 @@
 from zope.component import getUtility, getMultiAdapter
 
 from plone.portlet.static import static
-from plone.portlet.static.tests.base import TestCase
+from plone.portlet.static.testing import PLONEPORTLETSTATIC_INTEGRATION_TESTING
+
+import unittest2 as unittest
 
 
-class TestPortlet(TestCase):
+class TestPortlet(unittest.TestCase):
 
-    def afterSetUp(self):
-        self.setRoles(('Manager', ))
+    layer = PLONEPORTLETSTATIC_INTEGRATION_TESTING
+
+    def setUp(self):
+        self.portal = self.layer['portal']
+        self.folder = getattr(self.portal, 'test-folder')
+        setRoles(self.portal, TEST_USER_ID, ['Manager'])
+        login(self.portal, TEST_USER_NAME)
 
     def testPortletTypeRegistered(self):
         portlet = getUtility(IPortletType, name='plone.portlet.static.Static')
@@ -31,7 +44,7 @@ def testInvokeAddview(self):
             del mapping[m]
         addview = mapping.restrictedTraverse('+/' + portlet.addview)
 
-        addview.createAndAdd(data={'header' : u"test title", 'text' : u"test text"})
+        addview.createAndAdd(data={'header': u"test title", 'text': u"test text"})
 
         self.assertEquals(len(mapping), 1)
         self.failUnless(isinstance(mapping.values()[0], static.Assignment))
@@ -58,10 +71,15 @@ def testRenderer(self):
                         "Renderer should be available by default.")
 
 
-class TestRenderer(TestCase):
+class TestRenderer(unittest.TestCase):
+
+    layer = PLONEPORTLETSTATIC_INTEGRATION_TESTING
 
-    def afterSetUp(self):
-        self.setRoles(('Manager', ))
+    def setUp(self):
+        self.portal = self.layer['portal']
+        self.folder = getattr(self.portal, 'test-folder')
+        setRoles(self.portal, TEST_USER_ID, ['Manager'])
+        login(self.portal, TEST_USER_NAME)
 
     def renderer(self, context=None, request=None, view=None, manager=None, assignment=None):
         context = context or self.folder




-------------------------------------------------------------------------------


More information about the Testbot mailing list