def test_01_create_token(self): db_token = Token(self.serial1, tokentype="sms") db_token.save() token = SmsTokenClass(db_token) token.update({"phone": self.phone1}) token.save() self.assertTrue(token.token.serial == self.serial1, token) self.assertTrue(token.token.tokentype == "sms", token.token) self.assertTrue(token.type == "sms", token.type) class_prefix = token.get_class_prefix() self.assertTrue(class_prefix == "PISM", class_prefix) self.assertTrue(token.get_class_type() == "sms", token) db_token = Token(self.serial2, tokentype="sms") db_token.save() token = SmsTokenClass(db_token) token.update({"dynamic_phone": True}) token.save() self.assertTrue(token.token.serial == self.serial2, token) self.assertTrue(token.token.tokentype == "sms", token.token) self.assertTrue(is_true(token.get_tokeninfo("dynamic_phone"))) self.assertTrue(token.type == "sms", token.type) class_prefix = token.get_class_prefix() self.assertTrue(class_prefix == "PISM", class_prefix) self.assertTrue(token.get_class_type() == "sms", token) token.set_user(User(login="******", realm=self.realm1))
def test_01_create_token(self): db_token = Token(self.serial1, tokentype="sms") db_token.save() token = SmsTokenClass(db_token) token.update({"phone": self.phone1}) token.save() self.assertTrue(token.token.serial == self.serial1, token) self.assertTrue(token.token.tokentype == "sms", token.token) self.assertTrue(token.type == "sms", token.type) class_prefix = token.get_class_prefix() self.assertTrue(class_prefix == "PISM", class_prefix) self.assertTrue(token.get_class_type() == "sms", token)