本文整理汇总了Python中model.user.User.user_id方法的典型用法代码示例。如果您正苦于以下问题:Python User.user_id方法的具体用法?Python User.user_id怎么用?Python User.user_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类model.user.User
的用法示例。
在下文中一共展示了User.user_id方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_remote_user_id
# 需要导入模块: from model.user import User [as 别名]
# 或者: from model.user.User import user_id [as 别名]
def test_remote_user_id(self):
user_id = 'dummy'
user = User(remote_url='http://microblog.brianschrader.com/feed')
try:
# Should fail.
user.user_id = user_id
self.fail('Setting a remote user should be forbidden.')
except:
pass
示例2: test_local_user_id
# 需要导入模块: from model.user import User [as 别名]
# 或者: from model.user.User import user_id [as 别名]
def test_local_user_id(self):
user_id = '039567839084335446434534'
user = User(local_url='user/feed.xml')
try:
user.user_id = user_id
except Exception as e:
print e
self.fail('Setting local user user_id failed.')
self.assertEqual(user.user_id, user_id)
示例3: test_cached_user_id
# 需要导入模块: from model.user import User [as 别名]
# 或者: from model.user.User import user_id [as 别名]
def test_cached_user_id(self):
user_id = '544533534534543534'
user = User(entries={'user_id': user_id})
user_id = '54395490gejgo34'
try:
user.user_id = user_id
except Exception as e:
print e
self.fail('Setting cached user_id failed.')
self.assertEqual(user.user_id, user_id)