本文整理汇总了Python中tornado.util.ObjectDict.fs_push_secret方法的典型用法代码示例。如果您正苦于以下问题:Python ObjectDict.fs_push_secret方法的具体用法?Python ObjectDict.fs_push_secret怎么用?Python ObjectDict.fs_push_secret使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tornado.util.ObjectDict
的用法示例。
在下文中一共展示了ObjectDict.fs_push_secret方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: mogo_connect
# 需要导入模块: from tornado.util import ObjectDict [as 别名]
# 或者: from tornado.util.ObjectDict import fs_push_secret [as 别名]
from tornado.web import Application, RequestHandler, URLSpec
from tornroutes import route
from .mpatch import CapturePatch, Patch
from ..base import BaseHandler
from ... import settings
from ...models import User
# setup our database for tests
from mogo import connect as mogo_connect
mogo_connect('bastille_test')
settings = ObjectDict(settings)
# fake our foursquare push gorp
settings.fs_push_secret = 'yourmomma'
# i hate having a global var to capture the state of a monkey patched method but
# as long as tests are run serially, this should work well.
_render_state = {}
def patch_render(handler, template_name, **kwargs):
global _render_state
assert(not kwargs.has_key('template_name'))
assert(not kwargs.has_key('current_user'))
assert(not kwargs.has_key('final_request_uri'))
assert(not kwargs.has_key('html_body'))
kwargs['html_body'] = handler.render_string(template_name, **kwargs)
kwargs['template_name'] = template_name
kwargs['current_user'] = handler.current_user
kwargs['final_request_uri'] = handler.request.uri
_render_state = kwargs