[Zope3-dev] Death to "Views" package.

Steve Alexander steve@cat-box.net
Thu, 14 Nov 2002 09:17:33 +0000


> > Keep the views separate from the content. This makes the tests
> > separate too. Tests of views are typically very different than tests
> > of content.
>
> How so?


The tests on content are generally only testing to interfaces, with very 
little knowledge about the implementation of the content classes. You 
can expect to reuse the tests (or to easily refactor them for reuse) for 
other content classes that share those interfaces.

The tests on views are generally very specific to how the python 
portions of the view work. However, these python classes are not 
described by an interface.

> BTW, I don't like to see python expressions in ZPT. I want *all* of 
> the Python view logic in view methods, not ZPT. There are two reasons 
> for this:
>
> 1. It keeps the ZPT clean, and, more importantly
>
> 2. It keeps most of the logic testable. I don't like unit tests that
> compare html. If the vast majority of the logic is in Python, then I 
> can write unit tests in a pretty straightforward fashion.

+1

--
Steve Alexander