You should use an integration/funtional layer in this test.<br><br>The name is not really an unit test. It is an acceptance test.<br>You can do it in 3 ways:<br><br>1) Test directly in the View class API, instantiating it with the TestRequest class as parameter. This is called &quot;Under the skin&quot;(<a href="http://codebetter.com/blogs/jeremy.miller/archive/2006/06/08/146233.aspx">http://codebetter.com/blogs/jeremy.miller/archive/2006/06/08/146233.aspx</a>)<br>
<br>2) User the zopetestbrowser - Best option if your view doesn&#39;t have any javascript and you don&#39;t need a browser or an &quot;Your Application&quot; instance up and running to run the test.<br>Here you will need to use TestRequest as well.<br>
<br>3) Use selenium. But you will need to put an application instance running in order to run your tests.<br><br>good testing!<br><br><div class="gmail_quote">2009/4/8 Wichert Akkerman <span dir="ltr">&lt;<a href="mailto:wichert@wiggy.net">wichert@wiggy.net</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">How can you unittest a view? Trying to instantiate a view in a testcase<br>
fails when the constructor tries to access self.__view_name__ and<br>
self.module_info.<br>
<br>
Wichert.<br>
<font color="#888888"><br>
--<br>
Wichert Akkerman &lt;<a href="mailto:wichert@wiggy.net">wichert@wiggy.net</a>&gt;    It is simple to make things.<br>
<a href="http://www.wiggy.net/" target="_blank">http://www.wiggy.net/</a>                   It is hard to make things simple.<br>
_______________________________________________<br>
Grok-dev mailing list<br>
<a href="mailto:Grok-dev@zope.org">Grok-dev@zope.org</a><br>
<a href="http://mail.zope.org/mailman/listinfo/grok-dev" target="_blank">http://mail.zope.org/mailman/listinfo/grok-dev</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Vanderson Mota dos Santos<br><br>