Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor test fixture to load Dexterity content types when available #799

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hvelarde
Copy link
Member

@hvelarde hvelarde commented Aug 9, 2018

@idgserpro I need you help here: I want to simplify test fixture setup but I'm breaking something with form handling and I can't find the issue.

to check, just prepare the environment running bin/buildout buildout:test-eggs=plone.app.contenttypes and then run RF tests.

@idgserpro
Copy link
Member

Do these errors happen locally or only on travis?

@hvelarde
Copy link
Member Author

@idgserpro they happen locally also.

.travis.yml Outdated
@@ -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
Copy link
Member

Choose a reason for hiding this comment

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

Use:

- PLONE_VERSION=4.3 TEST_EGGS=buildout:test-eggs+=plone.app.contenttypes

We still have plone.app.referenceablebehavior in versions-4.3.x.cfg.

@@ -116,7 +116,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
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
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.

if HAS_PFG:
import Products.PloneFormGen
self.loadZCML(package=Products.PloneFormGen)
z2.installProduct(app, 'Products.PloneFormGen')
Copy link
Member

Choose a reason for hiding this comment

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

You are loading Products.PloneFormGen in Plone 5. This was done only in Plone 4.

@hvelarde
Copy link
Member Author

@idgserpro seems we are closer; there are still a couple of permission issues.

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

Copy link
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
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
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
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants