def test_expired(self):
        now = datetime(2014, 1, 1, 12, 0, 0)
        soon = now + timedelta(minutes=30)

        credentials = PublicCredentials(
            consumer_key='key',
            consumer_secret='secret',
            oauth_token='token',
            oauth_token_secret='token_secret',
        )

        # At this point, oauth_expires_at isn't set
        with self.assertRaises(XeroException):
            credentials.expired(now)

        # Not yet expired
        credentials.oauth_expires_at = soon
        self.assertFalse(credentials.expired(now=now))

        # Expired
        self.assertTrue(credentials.expired(now=soon))
Print a heading with data. The content can optionally be formatted by
dataset/ETHPy150Open freakboy3742/pyxero/tests/auth.py/PublicCredentialsTest.test_expired--crossover with--dataset/ETHPy150Open christabor/MoAL/MOAL/helpers/display.py/print_simple