[Zope3-dev] [Q] about functional testing support
Garrett Smith
garrett@mojave-corp.com
Thu, 24 Jul 2003 17:08:57 -0500
Fred L. Drake, Jr. wrote:
> I'm working on a sample "complex" widget that I'd like to have a few
> functional tests built around. This widget is *only* a sample, and
> shouldn't normally be included, but I want to have this supported in
> the core Zope 3 unit and functional tests since this will be the only
> substantial test of how some of the vocabulary field/widget
> machinations are supposed to work together.
>=20
> This will introduce a new package with a few modules, and test
> packages to back it up. There's a ZCML file that knits the pieces
> together, and that's where my question comes in.
>=20
> Is the top-level ftesting.zcml the right place to include the
> additional ZCML, or is there a better place? What's there now seems
> more general, but I don't see another place offhand. I definately
> don't want it to get loaded along with the "normal" ZCML loaded for
> Zope 3.
For my widget ftests, I created some 'hook up' helper functions and
added them to a support module in the ftests package. E.g.
def registerEditForm(schema):
config =3D StringIO("""
<zopeConfigure xmlns=3D"http://namespaces.zope.org/browser">
<editform
name=3D"edit.html"
schema=3D"%s"
permission=3D"zope.View" />
</zopeConfigure>
""" % schema.__identifier__)
xmlconfig(config)
-- Garrett