def test_can_use_internally_defined_arguments(self): """Can use argument names that are internally used by TG in controllers""" class App(controllers.RootController): @expose() def index(self, **kw): return "\n".join(["%s:%s" % i for i in kw.iteritems()]) testutil.mount(App(), '/') response = self.app.get("/?format=foo&template=bar&fragment=boo") assert "format:foo" in response assert "template:bar" in response assert "fragment:boo" in response
def setup_module(): testutil.unmount() testutil.mount(MyRoot()) testutil.mount(NestedController(), "/nestedcontroller") testutil.start_server()
def setup_module(): testutil.unmount() testutil.mount(MyRoot()) testutil.start_server()
def test_index_trailing_slash(self): """If there is no trailing slash on an index method call, redirect""" testutil.mount(SubApp(), '/') testutil.mount(SubApp(), '/foo') self.app.get("/foo", status=302)
def setUp(self): testutil.mount(MyRoot(), '/') testutil.mount(SubApp(), '/subthing') testutil.mount(SubApp(), '/subthing/subsubthing') self.app = testutil.make_app() super(TestURLs, self).setUp()