[Grok-dev] How does one unittest a view?
wichert at wiggy.net
Wed Apr 8 10:11:47 EDT 2009
On 4/8/09 4:07 PM, Uli Fouquet wrote:
> Hi there,
> Wichert Akkerman wrote:
>> How can you unittest a view? Trying to instantiate a view in a testcase
>> fails when the constructor tries to access self.__view_name__ and
> Maybe something like this?
> :test-layer: unit
> >>> import grok
> >>> grok.testing.grok('sample')
That groks the whole sample package, right? I do not want that, since
that can have all kinds of effects. What I am looking for is the very
minimal thing that allows me to instantiate a view so I can call methods
on it. Currently I use this:
# grok makes unit testing extremely painful
View.__view_name__ = "iew"
# Do the tests here
which works, but is not quite optimal
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Grok-dev