Example #1
0
    def test_long_lived_access_token(self):
        a_week_from_now = datetime.datetime.utcnow() + datetime.timedelta(weeks=1)
        access_token = AccessToken(self.foo_token, expires_at=a_week_from_now)

        self.assertTrue(access_token.is_long_lived())
Example #2
0
    def test_short_lived_access_token(self):
        an_hour_from_now = datetime.datetime.utcnow() + datetime.timedelta(hours=1)
        access_token = AccessToken(self.foo_token, expires_at=an_hour_from_now)

        self.assertFalse(access_token.is_long_lived())