本文整理汇总了Python中pyramid.testing.DummyRequest.userdb方法的典型用法代码示例。如果您正苦于以下问题:Python DummyRequest.userdb方法的具体用法?Python DummyRequest.userdb怎么用?Python DummyRequest.userdb使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyramid.testing.DummyRequest
的用法示例。
在下文中一共展示了DummyRequest.userdb方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: dummy_request
# 需要导入模块: from pyramid.testing import DummyRequest [as 别名]
# 或者: from pyramid.testing.DummyRequest import userdb [as 别名]
def dummy_request(self):
request = DummyRequest()
request.context = DummyResource()
request.userdb = self.userdb
request.db = self.db
request.registry.settings = self.settings
return request
示例2: dummy_request
# 需要导入模块: from pyramid.testing import DummyRequest [as 别名]
# 或者: from pyramid.testing.DummyRequest import userdb [as 别名]
def dummy_request(self, cookies={}):
request = DummyRequest()
request.context = DummyResource()
request.userdb = self.userdb
request.userdb_new = self.userdb_new
request.db = self.db
request.registry.settings = self.settings
def propagate_user_changes(user):
"""
Make sure there is a request.context.propagate_user_changes in testing too.
"""
logger.debug('FREDRIK: Testing dummy_request.context propagate_user_changes')
return self.request.amrelay.request_sync(user)
request.context.propagate_user_changes = propagate_user_changes
return request