Esempio n. 1
0
    def test_client_expires_at_consistency(self):
        from redis import Redis
        from wechatpy.session.redisstorage import RedisStorage

        redis = Redis()
        session = RedisStorage(redis)
        client1 = WeChatClient(self.app_id, self.secret, session=session)
        client2 = WeChatClient(self.app_id, self.secret, session=session)
        assert client1.expires_at == client2.expires_at
        expires_at = time.time() + 7200
        client1.expires_at = expires_at
        assert client1.expires_at == client2.expires_at == expires_at