On Thursday 21 May 2009 08:22:24 Jorge Vargas wrote:
I finally did.
> On Mon, May 18, 2009 at 6:55 AM, Diez B. Roggisch <de...
> > Hi,
> > is there a way to obtain a reference to the root-controller-object so
> > that I can attach a hierarchy of test-only controllers to it?
> > This is TG2 of course.
> I don't know but I'll sure love to know if you find out.
Assuming the paster-stuff is bootstrapped through code like
here_dir = os.path.dirname(os.path.abspath(ableton.__file__))
conf_dir = os.path.dirname(here_dir)
wsgiapp = loadapp('config:test.ini', relative_to=conf_dir)
you then can do it simply like this (inside a function/method!!)
import myproject.controllers.root as root
root.RootController.mountpoint = TestController()
Then you can access the controller through the usual
Of course mounting of whole controller hierarchies is perfectly fine.
So I create a function in our base-test-class that allows to register a passed
controller for a given mountpoint. Voila, greatness ensues.