def test_decode_str_token(self):
     with self.app.app_context():
         token = generate_subscriber_token(self.subscriber)
         token_str = token.decode('utf-8')
         decoded = decode_subscriber_token(token_str)
         self.assertEqual(self.subscriber['_id'], decoded['sub'])
 def test_generate_token_for_subscriber(self):
     with self.app.app_context():
         token = generate_subscriber_token(self.subscriber)
         decoded = decode_subscriber_token(token)
         self.assertEqual(self.subscriber['_id'], decoded['sub'])