From fe399b8d88746fda216a66bf80f6185ddf0fbac2 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sat, 28 Nov 2009 19:22:23 +0000 Subject: Clarify. --- repoze/bfg/testing.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'repoze/bfg/testing.py') diff --git a/repoze/bfg/testing.py b/repoze/bfg/testing.py index 97956ef48..1859cf9b8 100644 --- a/repoze/bfg/testing.py +++ b/repoze/bfg/testing.py @@ -526,16 +526,19 @@ class DummyRequest: def setUp(registry=None, request=None, hook_zca=True): """ Set BFG registry and request thread locals for the duration of a - unit test. + single unit test. .. note:: The ``setUp`` function is new as of :mod:`repoze.bfg` 1.1. - Use in the ``setUp`` method of unit test code which uses any of - the ``register*`` functions in ``repoze.bfg.testing`` (such as - ``repoze.bfg.testing.registerDummySecurityPolicy``) or unit test - code that uses the ``repoze.bfg.threadlocal.get_current_registry`` - or ``repoze.bfg.threadlocal.get_current_request`` functions. + Use this function in the ``setUp`` method of a unit test test case + which directly or indirectly uses: + + - any of the ``register*`` functions in ``repoze.bfg.testing`` + (such as ``repoze.bfg.testing.registerModels``) + + - the ``repoze.bfg.threadlocal.get_current_registry`` or + ``repoze.bfg.threadlocal.get_current_request`` functions. If you use the ``testing.register*`` APIs, or the ``get_current_*`` functions (or call :mod:`repoze.bfg` code that -- cgit v1.2.3