On Wed, 2010-06-30 at 06:50 +0100, Chris Withers wrote:
> Chris McDonough wrote:
> > ... in the test setup.  If so, you actually need to do:
> > 
> > config.scan('mypackage')
> > 
> > .. where mypackage is the name of the Python package holding the
> > application you're trying to test.
> That won't help, since the ViewIntegrationTests linked to my Alex still 
> call the view directly, which won't trigger any of the stuff that 
> venusian does, or any imperative configuration, or even anything 
> configured via zcml unless `my_view` happens to render its own template 
> inside the body of the function, which I'd guess most views avoid doing 
> as it makes them harder to unit test...

True.  I guess Alex' statement about "works via ZCML only"  made me
offer the above suggestion as a
 answer. ;-)  But alas, ZCML vs. scanning isn't the difference at all, so I'm 
not sure what worked via ZCML and what didn't work via scanning at all.

As far as integration testing of a view, you might be able to use the
render_view API if you can arrange for the context, request, and view
name to be right:

- C

Repoze-dev mailing list

Reply via email to