当前位置: 首页>>代码示例>>Python>>正文


Python User.getUID方法代码示例

本文整理汇总了Python中users.User.getUID方法的典型用法代码示例。如果您正苦于以下问题:Python User.getUID方法的具体用法?Python User.getUID怎么用?Python User.getUID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在users.User的用法示例。


在下文中一共展示了User.getUID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_getRID_works

# 需要导入模块: from users import User [as 别名]
# 或者: from users.User import getUID [as 别名]
 def test_getRID_works(self):
     # Ensure that getRID() works as expected.
     timestamp = str(datetime.datetime.now())
     new_timestamp = timestamp.replace(":", "")
     with self.client:
         self.client.post(
             '/login',
             data=dict(email="[email protected]", password="password456"),
             follow_redirects=True
         )
         self.client.post(
             '/dashboard/reactions/enotify',
             data=dict(name=new_timestamp, trigger=1,
                       frequency=1, email="[email protected]",
                       send_true=True),
             follow_redirects=True
         )
         user = User()
         user_id = user.getUID('[email protected]', g.rdb_conn)
         get_reaction_id = Reaction()
         response = get_reaction_id.getRID(
             new_timestamp+':'+user_id, g.rdb_conn)
         results = r.table('reactions').filter(
             {'name': new_timestamp}).run(g.rdb_conn)
         for result in results:
             reaction_id = result['id']
             break
         self.assertEqual(response, reaction_id)
开发者ID:Runbook,项目名称:runbook,代码行数:30,代码来源:test_reactions.py

示例2: test_get_by_id

# 需要导入模块: from users import User [as 别名]
# 或者: from users.User import getUID [as 别名]
 def test_get_by_id(self):
     # Ensure id is correct for the current/logged in user
     with self.client:
         response = self.client.post('/login', data=dict(
             email='[email protected]', password='password456'
         ), follow_redirects=True)
         print response
         logged_in_user_id = verifyLogin(
             app.config['SECRET_KEY'],
             app.config['COOKIE_TIMEOUT'],
             request.cookies
         )
         user = User()
         user_id = user.getUID('[email protected]', g.rdb_conn)
         self.assertTrue(logged_in_user_id == user_id)
开发者ID:rbramwell,项目名称:runbook,代码行数:17,代码来源:test_user.py


注:本文中的users.User.getUID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。