I am new to testing, and I am trying to create a test for my Plone product for the first time. I'm on Plone 3.3.
The basic test suite works, I can execute it without errors. I have completed this documentation: http://plone.org/documentation/kb/testing
... except that I write my tests in Python classes and not in doctrines.
My problem is that I cannot access the views defined in my application (I get a ComponentLookupError).
The problem seems to be related to the “browser” defined by my applications. When I remove the layer = "..." attribute from my configure.zcml, the test can access the views without problems. However, if I add it back, this will not work. I assume that since the browser interface does not apply to the request.
The only link to this problem I found in tests for googlesitemap: http://dev.plone.org/collective/browser/googlesitemap/googlesitemap.common/trunk/googlesitemap/common/tests?rev=
It seems that the author made his own ZCML file for a test in which the layer = "..." attribute was removed. (which will work, but it seems very bad to have a separate zcml file for tests)
In my test, I included the following (taken from googlesitemap tests), which passes:
from jambette.site.interfaces import IJambetteLayer
from plone.browserlayer.utils import registered_layers
self.assertTrue(IJambetteLayer in registered_layers())
, , - .
-, , ?