本文整理汇总了Python中privacyidea.lib.tokens.emailtoken.EmailTokenClass.set_user_identifiers方法的典型用法代码示例。如果您正苦于以下问题:Python EmailTokenClass.set_user_identifiers方法的具体用法?Python EmailTokenClass.set_user_identifiers怎么用?Python EmailTokenClass.set_user_identifiers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类privacyidea.lib.tokens.emailtoken.EmailTokenClass
的用法示例。
在下文中一共展示了EmailTokenClass.set_user_identifiers方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_02_set_user
# 需要导入模块: from privacyidea.lib.tokens.emailtoken import EmailTokenClass [as 别名]
# 或者: from privacyidea.lib.tokens.emailtoken.EmailTokenClass import set_user_identifiers [as 别名]
def test_02_set_user(self):
db_token = Token.query.filter_by(serial=self.serial1).first()
token = EmailTokenClass(db_token)
self.assertTrue(token.token.tokentype == "email",
token.token.tokentype)
self.assertTrue(token.type == "email", token.type)
token.set_user(User(login="cornelius",
realm=self.realm1))
self.assertTrue(token.token.resolver_type == "passwdresolver",
token.token.resolver_type)
self.assertTrue(token.token.resolver == self.resolvername1,
token.token.resolver)
self.assertTrue(token.token.user_id == "1000",
token.token.user_id)
user_object = token.get_user()
self.assertTrue(user_object.login == "cornelius",
user_object)
self.assertTrue(user_object.resolver == self.resolvername1,
user_object)
token.set_user_identifiers(2000, self.resolvername1, "passwdresolver")
self.assertTrue(int(token.token.user_id) == 2000, token.token.user_id)