def throttle_app(request, paster_config):
'''Custom WSGI app with permission test views enabled.'''
class Initializer(websauna.system.Initializer):
def configure_views(self):
self.config.add_route("throttle_sample", "/")
self.config.add_view(throttle_sample, route_name="throttle_sample", decorator=throttled_view(limit=1))
def configure_csrf(self):
"""Disable CSRF for this test run for making testing simpler."""
self.config.set_default_csrf_options(require_csrf=False)
global_config, app_settings = paster_config
init = Initializer(global_config, app_settings)
init.run()
app = TestApp(init.make_wsgi_app())
app.init = init
return app
评论列表
文章目录