Refactor test fixture to load Dexterity content types when available#799
Refactor test fixture to load Dexterity content types when available#799
Conversation
|
Do these errors happen locally or only on travis? |
|
@idgserpro they happen locally also. |
| 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.
Use:
- PLONE_VERSION=4.3 TEST_EGGS=buildout:test-eggs+=plone.app.contenttypesWe still have plone.app.referenceablebehavior in versions-4.3.x.cfg.
| # 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.
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.
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') |
There was a problem hiding this comment.
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.
You aren't applying the profile of plone.app.contenttypes.
There was a problem hiding this comment.
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.
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.
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.contenttypesand then run RF tests.