def test_is_trading_date(self): self.assertTrue(stockdate.is_trading_date(datetime(2015, 8, 31, 9, 35, 21))) self.assertFalse(stockdate.is_trading_date(datetime(2015, 5, 1)))
def update_all_data(self): now = datetime.now() if (stockdate.is_trading_date(now) and now.hour >= 15 or stockdate.is_trading_datetime(now)): self.update_funda(now)