[Zope-dev] Unit testing an application's user interface

Jeff K. Hoffman jeff.hoffman@goingv.com
Thu, 29 Jun 2000 15:17:42 -0400 (EDT)


On Thu, 29 Jun 2000, Andrew Wilcox wrote:

> So what I need to be doing is to plug into Zope at the right point, say
> here's my URL path and request variables, do your thing, get control back,
> and then have a chance check out what happened to the affected objects in
> the ZODB.

You may want to read:

  http://www.zope.org/Members/michel/HowTos/TheDebuggerIsYourFriend

Cliff's Notes version:

  0. Shutdown Zope.

  1. Start python in $ZOPE/lib/python.

    Python 1.5.2 (#3, Mar  8 2000, 16:34:52) [C] on sunos5
    Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
    >>>

  2. Import the Zope and ZPublisher modules.

    >>> import Zope, ZPublisher
    >>>

  3. Make sure we're working.

    >>> ZPublisher.Zope('/index_html?foo=bar')
    Status: 200 OK
    X-Powered-By: Zope (www.zope.org), Python (www.python.org)
    Content-Length: 607
    Content-Type: text/html

    <HTML>
    <HEAD>
      <TITLE>Zope</TITLE>
    </HEAD>

    <BODY BGCOLOR="#FFFFFF">
    The value of foo is bar.
    </BODY>
    </HTML>
    ____________________________________________________________

    >>>

> Andrew

Hope this helps,

--Jeff

---
Jeff K. Hoffman                               704.849.0731 x108
Chief Technology Officer                      mailto:jeff.hoffman@goingv.com
Going Virtual, L.L.C.                         http://www.goingv.com/