def test_session_create(self):
     user = User.load_by_id(db.user.create("test"))
     token = Token.generate(user.api_key)
     token.approve(user.name)
     session = Session.create(token)
     self.assertIsInstance(session, Session)
     self.assertDictEqual(user.__dict__, session.user.__dict__)
 def test_session_create(self):
     user = User.load_by_id(db.user.create("test"))
     token = Token.generate(user.api_key)
     token.approve(user.name)
     session = Session.create(token)
     self.assertIsInstance(session, Session)
     self.assertDictEqual(user.__dict__, session.user.__dict__)
    def test_session_load(self):
        user = User.load_by_id(db.user.create("test"))
        token = Token.generate(user.api_key)
        token.approve(user.name)
        session = Session.create(token)
        self.assertIsInstance(session, Session)
        self.assertDictEqual(user.__dict__, session.user.__dict__)
        session.user = None

        # Load with session_key + api_key
        session2 = Session.load(session.sid, session.api_key)
        self.assertDictEqual(user.__dict__, session2.__dict__['user'].__dict__)
        session2.user = None
        self.assertDictEqual(session.__dict__, session2.__dict__)
    def test_session_load(self):
        user = User.load_by_id(db.user.create("test"))
        token = Token.generate(user.api_key)
        token.approve(user.name)
        session = Session.create(token)
        self.assertIsInstance(session, Session)
        self.assertDictEqual(user.__dict__, session.user.__dict__)
        session.user = None

        # Load with session_key + api_key
        session2 = Session.load(session.sid, session.api_key)
        self.assertDictEqual(user.__dict__, session2.__dict__['user'].__dict__)
        session2.user = None
        self.assertDictEqual(session.__dict__, session2.__dict__)
 def test_user_load_by_id(self):
     user = User.load_by_id(self.user.id)
     assert isinstance(user, User) == True
     self.assertDictEqual(user.__dict__, self.user.__dict__)
 def test_user_load_by_id(self):
     user = User.load_by_id(self.user.id)
     assert isinstance(user, User) == True
     self.assertDictEqual(user.__dict__, self.user.__dict__)