[Zope3-Users] Calling a view in a doc test

Marius Gedminas mgedmin at b4net.lt
Tue Jun 19 10:14:13 EDT 2007


On Mon, Jun 18, 2007 at 10:14:14PM +0200, Florian Lindner wrote:
> Am Dienstag, 5. Juni 2007 schrieb Marius Gedminas:
> > I would suggest that you remove everything and keep just
> >
> >   def blogSetUp(test):
> 
> zope.testing.module.setUp(test, 'Blog.doctest')
> 
> it worked after I've added the line above.

That's good.

(I've no idea what zope.testing.module.setUp does).

> >       setup.placelessSetUp()
> >       setup.setUpTraversal()
> >
> >   def blogTearDown(test):
> >       setup.placelessTearDown()
> >
> > > and this is my README.txt containing the test:
> > >     >>> context = MyBlog
> >
> > You may want to actually create the object:
> >       >>> context = MyBlog()
> 
> MyBlog is the instance.

That's confusing.  In Python it is customary to have class names start
with a captial letter, and function/variable names start with a
lowercase letter.  (Factory functions, whose primary purpose is to
create new objects, are also sometimes named with a starting capital
letter.)

Regards,
Marius Gedminas
-- 
Any time somebody tells you that you shouldn't do something because it's
"unprofessional," you know that they've run out of real arguments.
		-- Joel Spolski
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope3-users/attachments/20070619/8cf30fe7/attachment.bin


More information about the Zope3-users mailing list