Example #1
0
 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)
Example #2
0
 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'])
Example #3
0
 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)