-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
customActions from plone.supermodel are being called before all config are done when using plone.app.testing #39
Comments
Investigating a little more, I discovered that isn't the I also discovered that the We could just add the So I suggest add: <include zcml:condition="installed plone.autoform" package="plone.autoform" /> before this supermodel line. Thus, we ensure that the @mauritsvanrees @davisagli @hvelarde opinions? |
I can't help on this; sorry but it's out of my current knowledge. |
* Use Firefox 45.8.0esr instead of latest-esr * Use getIcon from plone_layout helper view This method was deprecated and has been removed from Plone 5.1. * Remove image traverses test from basic tile The test makes no sense as it was implemented and is failing with newer versions of Pillow. * Use Plone 4.3.11 for tests on 4.3 branch Refs: plone/plone.app.testing#39 * Use plone.api 1.6 on builds using Archetypes See: plone/plone.api#364
That seems to make sense, and it fixes the problems with the |
@idgserpro When I try your fix and run the
The zcml file from the last line seems innocent: the directive is there. So while it seemed okay, this is not the right solution. |
@mauritsvanrees really weird. Like you said, the directive is there. When I have the time, I take a look at coredev. |
@mauritsvanrees the problem is that coredev tests include plone.autoform egg. It is not an isolated test with only plone.supermodel dependencies. Then the condition:
will be true and the plone.autoform zcml will be included in the plone.supermodel tests. The test needs to be reviewed considering this. |
@mauritsvanrees for the directive to work, it's necessary load the <include package="Products.Five" file="configure.zcml" /> in In addition, you need to change the schema.txt test to consider the Failure in test /home/user/buildout.coredev/src/plone.supermodel/plone/supermodel/schema.txt
Failed doctest test for schema.txt
File "/home/user/buildout.coredev/src/plone.supermodel/plone/supermodel/schema.txt", line 0
----------------------------------------------------------------------
File "/home/user/buildout.coredev/src/plone.supermodel/plone/supermodel/schema.txt", line 110, in schema.txt
Failed example:
print serializeModel(model) # doctest: +NORMALIZE_WHITESPACE
Expected:
<model xmlns:i18n="http://xml.zope.org/namespaces/i18n" xmlns="http://namespaces.plone.org/supermodel/schema">
<schema>
<field name="title" type="zope.schema.TextLine">
<title>Title</title>
</field>
<field name="description" type="zope.schema.Text">
<description>A short summary</description>
<min_length>10</min_length>
<required>False</required>
<title>Description</title>
</field>
</schema>
</model>
Got:
<model xmlns:i18n="http://xml.zope.org/namespaces/i18n" xmlns:security="http://namespaces.plone.org/supermodel/security" xmlns:form="http://namespaces.plone.org/supermodel/form" xmlns="http://namespaces.plone.org/supermodel/schema">
<schema>
<field name="title" type="zope.schema.TextLine">
<title>Title</title>
</field>
<field name="description" type="zope.schema.Text">
<description>A short summary</description>
<min_length>10</min_length>
<required>False</required>
<title>Description</title>
</field>
</schema>
</model> |
I describing the issue in dept here: collective/collective.cover#759 I already have a workaround. |
@hvelarde The problem is already described here, I didn't get it why you opened another one in collective.cover... @mauritsvanrees can you help us here? We gave two suggestions on how to solve the problem: If you don't agree in plone.autoform influencing plone.supermodel tests, can you at least analyse adding plone.autoform before TinyMCE in
|
@davisagli can you give a clue here? I see you're the father of the creature ;) |
This happened in collective.cover's PR after Plone 4.3.12 release.
Using Plone 4.3.11, collective.cover tests were working. They stopped working in 4.3.12. We detected (by doing a pdb in supermodel finalizeSchema) that the cause is cover's supermodel fields that aren't "loaded". supermodel needs to execute a customAction after all zcml are loaded. For some zcml dependency we didn't detected yet, in Plone 4.3.12, supermodel is loaded along packages that plone.app.testing loads. At that moment, cover's zcml isn't loaded yet so supermodel's customAction don't consider cover configurations, giving the error.
When
bin/instance
is called, xmlconfig.file is called only one time. Whenbin/test
is called, xmlconfig.file is called for each package in products. So thecustomActions
are executed multiple times inbin/test
making customActions of supermodel being executed before collective.cover's configuration.We don't know which package in
plone.app.testing/plone/app/testing/layers.py
Line 38 in 62b236e
The text was updated successfully, but these errors were encountered: