def test_03_get_init_details(self):
        db_token = Token.query.filter(Token.serial == self.serial1).first()
        token = PaperTokenClass(db_token)
        token.update({})

        # if no otpkey was given, an OTP key is created.
        init_detail = token.get_init_detail()
        self.assertTrue("otps" in init_detail)
    def test_02_class_methods(self):
        db_token = Token.query.filter(Token.serial == self.serial1).first()
        token = PaperTokenClass(db_token)

        info = token.get_class_info()
        self.assertEqual(info.get("title"), "Paper Token")

        info = token.get_class_info("title")
        self.assertEqual(info, "Paper Token")
 def test_01_create_token(self):
     db_token = Token(self.serial1, tokentype="paper")
     db_token.save()
     token = PaperTokenClass(db_token)
     token.update({})
     self.assertEqual(token.token.serial, self.serial1)
     self.assertEqual(token.token.tokentype, "paper")
     self.assertEqual(token.type, "paper")
     class_prefix = token.get_class_prefix()
     self.assertEqual(class_prefix, "PPR")
     self.assertEqual(token.get_class_type(), "paper")