<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 19, 2016 at 10:20 PM, Thomas De Schampheleire <span dir="ltr"><<a href="mailto:patrickdepinguin@gmail.com" target="_blank">patrickdepinguin@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Currently the test initialization code has<br>
some pylons specifics which I don't understand (and thus fail to<br>
convert to a Turbogears equivalent).<br>
<br>
Essentially, the setup code in TestController is:<br>
<br>
        self.wsgiapp = pylons.test.pylonsapp<br>
        init_stack(self.wsgiapp.config)<br>
        self.app = TestApp(self.wsgiapp)<br>
<br>
with init_stack being:<br>
<br>
def init_stack(config=None):</blockquote><div><br></div><div>I didn't have time to look at it so far, sorry, but by a quick view of what init_stack is doing it looks like it's mostly setting up the Pylons global objects even when not inside a request. That should be fairly equivalent to performing a request to '/_test_vars' in TurboGears or using <a href="http://turbogears.readthedocs.org/en/latest/reference/classes.html#tg.util.webtest.test_context">http://turbogears.readthedocs.org/en/latest/reference/classes.html#tg.util.webtest.test_context</a> </div><div><br></div><div>See <a href="http://turbogears.readthedocs.org/en/latest/turbogears/testing.html#testing-outside-controllers">http://turbogears.readthedocs.org/en/latest/turbogears/testing.html#testing-outside-controllers</a> it might provide a few useful details.</div><div> </div></div></div></div>