-
Notifications
You must be signed in to change notification settings - Fork 55
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
base: master
Are you sure you want to change the base?
Conversation
Do these errors happen locally or only on travis? |
@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 |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
src/collective/cover/testing.py
Outdated
if HAS_PFG: | ||
import Products.PloneFormGen | ||
self.loadZCML(package=Products.PloneFormGen) | ||
z2.installProduct(app, 'Products.PloneFormGen') |
There was a problem hiding this comment.
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.
fcb01a5
to
01f70e3
Compare
@idgserpro seems we are closer; there are still a couple of permission issues. |
else: | ||
if DEXTERITY_ONLY: | ||
self.applyProfile(portal, 'plone.app.contenttypes:default') | ||
|
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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
``
There was a problem hiding this comment.
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 😢 .
There was a problem hiding this comment.
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.
@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.