Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ addons:
env:
matrix:
- PLONE_VERSION=4.3
- PLONE_VERSION=4.3 DEXTERITY_ONLY=true
- PLONE_VERSION=4.3 TEST_EGGS=buildout:test-eggs+=plone.app.contenttypes
- PLONE_VERSION=4.3 VERSIONS=versions:plone.app.jquery=1.9.2
- PLONE_VERSION=5.1
matrix:
Expand All @@ -29,8 +29,8 @@ install:
- sed -ie "s#test-4.3#test-$PLONE_VERSION#" buildout.cfg
- sed -ie "s#versions-4.3#versions-$PLONE_VERSION#" buildout.cfg
- python bootstrap.py
- bin/buildout $VERSIONS annotate
- bin/buildout $VERSIONS
- bin/buildout $TEST_EGGS $VERSIONS annotate
- bin/buildout $TEST_EGGS $VERSIONS
before_script:
- export ROBOT_SELENIUM2LIBRARY_RUN_ON_FAILURE="Capture Page Screenshot"
- export DISPLAY=:99.0
Expand Down
24 changes: 5 additions & 19 deletions src/collective/cover/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from plone.app.robotframework.testing import AUTOLOGIN_LIBRARY_FIXTURE
from plone.app.testing import FunctionalTesting
from plone.app.testing import IntegrationTesting
from plone.app.testing import PLONE_FIXTURE
from plone.app.testing import PloneSandboxLayer
from plone.testing import z2

Expand All @@ -29,10 +28,11 @@
try:
pkg_resources.get_distribution('plone.app.contenttypes')
except pkg_resources.DistributionNotFound:
from plone.app.testing import PLONE_FIXTURE
DEXTERITY_ONLY = False
else:
# this environment variable is set in .travis.yml test matrix
DEXTERITY_ONLY = os.environ.get('DEXTERITY_ONLY') is not None
from plone.app.contenttypes.testing import PLONE_APP_CONTENTTYPES_FIXTURE as PLONE_FIXTURE
DEXTERITY_ONLY = True


# XXX: PFG tile is deprecated and will be removed in collective.cover 3
Expand Down Expand Up @@ -119,7 +119,7 @@ def generate_jpeg(width, height):

# FIXME: workaround for https://github.com/plone/plone.app.testing/issues/39
# Products.TinyMCE is used only in Plone 4
if not IS_PLONE_5:
if not DEXTERITY_ONLY:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workaround must be present in all test of Plone 4. Not only in those that don't have dexterity.

But I still think than plone/plone.app.testing#39 should be fixed. Please do a PR there to see what happens.

Copy link
Copy Markdown
Member

@idgserpro idgserpro Aug 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EDIT: this test don't have dexterity. So the workaround must be present in all test of Plone 4.

autoform = ('plone.autoform', {'loadZCML': True})
tinymce = ('Products.TinyMCE', {'loadZCML': True})
products = list(PLONE_FIXTURE.products)
Expand All @@ -132,19 +132,11 @@ class Fixture(PloneSandboxLayer):
defaultBases = (PLONE_FIXTURE,)

def setUpZope(self, app, configurationContext):
if IS_PLONE_5:
import plone.app.contenttypes
self.loadZCML(package=plone.app.contenttypes)
else:
if not IS_PLONE_5:
# needed by plone.app.linkintegrity under Plone 4.x
import plone.app.referenceablebehavior
self.loadZCML(package=plone.app.referenceablebehavior)

if DEXTERITY_ONLY:
import plone.app.contenttypes
self.loadZCML(package=plone.app.contenttypes)
z2.installProduct(app, 'Products.DateRecurringIndex')

if HAS_PFG:
import Products.PloneFormGen
self.loadZCML(package=Products.PloneFormGen)
Expand All @@ -161,12 +153,6 @@ def setUpZope(self, app, configurationContext):
manage_addVirtualHostMonster(app, 'virtual_hosting')

def setUpPloneSite(self, portal):
if IS_PLONE_5:
self.applyProfile(portal, 'plone.app.contenttypes:default')
else:
if DEXTERITY_ONLY:
self.applyProfile(portal, 'plone.app.contenttypes:default')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You aren't applying the profile of plone.app.contenttypes.

Copy link
Copy Markdown
Member Author

@hvelarde hvelarde Aug 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need to; it's already applied above:

-    # this environment variable is set in .travis.yml test matrix
-    DEXTERITY_ONLY = os.environ.get('DEXTERITY_ONLY') is not None
+    from plone.app.contenttypes.testing import PLONE_APP_CONTENTTYPES_FIXTURE as PLONE_FIXTURE
+    DEXTERITY_ONLY = True
``

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! But it's changing the portal's default workflow to simple_publication_workflow, which is causing permission errors. However, when we create a portal the workflow is simple_publication_workflow. Maybe it's the cover tests that are wrong 😢 .

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the problem may be in the tests or in the view permissions.

if HAS_PFG:
self.applyProfile(portal, 'Products.PloneFormGen:default')

Expand Down
1 change: 0 additions & 1 deletion versions-4.3.x.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[buildout]
test-eggs =
plone.app.contenttypes
plone.app.referenceablebehavior
Products.PloneFormGen

Expand Down