Ha you guys are fast.

In addition to what they said you probably want to focus on 4
potential problems(4 tests).

1.  Make sure the widget's template compiles and you can import it..
by trying to import it.
from project.widgets import MyWidget

2. Make sure the widget instantiates.
myWidget = MyWidget(**defaultParams)

3.  Make sure the wiget's template is correctly interpolating by calling render.
myWidgetOutput = myWidget.render(**params)

4.  Check that the output of the widget's render method is correct by
checking string inclusion.
assert someString in myWidgetOutput

-Ian

On 4/9/07, Jorge Godoy <[EMAIL PROTECTED]> wrote:
>
> "Disrupt07" <[EMAIL PROTECTED]> writes:
>
> > Thanks a lot.
> >
> > Some of my (related) questions are:
> >
> > Can one test method have multiple assert statements?
>
> Yes, but then it's not a "unit" anymore.  Why not having multiple tests
> testing each behavior?
>
> > What other assert statements can be created? (e.g. not just string
> > match)
>
> Take a look at the docs for the test module you're using.  There are several
> of them...
>
> For the standard case: http://docs.python.org/lib/module-unittest.html
>
>
> --
> Jorge Godoy      <[EMAIL PROTECTED]>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to