Skip to content

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

Open
hvelarde wants to merge 2 commits intomasterfrom
hvelarde-dexterity
Open

Refactor test fixture to load Dexterity content types when available#799
hvelarde wants to merge 2 commits intomasterfrom
hvelarde-dexterity

Conversation

@hvelarde
Copy link
Copy Markdown
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
Copy Markdown
Member

Do these errors happen locally or only on travis?

@hvelarde
Copy link
Copy Markdown
Member Author

@idgserpro they happen locally also.

Comment thread .travis.yml Outdated
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
Copy Markdown
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.

# 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.

if HAS_PFG:
import Products.PloneFormGen
self.loadZCML(package=Products.PloneFormGen)
z2.installProduct(app, 'Products.PloneFormGen')
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 are loading Products.PloneFormGen in Plone 5. This was done only in Plone 4.

@hvelarde hvelarde force-pushed the hvelarde-dexterity branch from fcb01a5 to 01f70e3 Compare August 23, 2018 19:01
@hvelarde
Copy link
Copy Markdown
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
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.

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