def _create_app(cls, default_url, roots): views.load(roots=roots) if default_url is not None: views.add_default_view(default_url) mapping = ('(.+)', cls) web.config.debug = False return web.application(mapping)
def test(self): views.add_default_view('/users/home') request = { 'cookies': {}, 'fields': {}, 'headers': {}, 'path': Path('/'), } view = views._abs_pathes['/'] with self.assertRaises(RedirectResponse) as ctx: view.render(request) self.assertEqual('/users/home', ctx.exception.headers['Location'])
def wsgi(default_url=None, roots=('views',)): views.load(roots=roots) if default_url is not None: views.add_default_view(default_url) return WSGIApplication([('(.*)', GaeCoor)], debug=False)